Midterm 2 - Illinois Institute of Technology Department of...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Illinois Institute of Technology Department of Computer Science Midterm 2 CS 331— Data-Structures Spring 2007 April 9, 2007 15:15–16:30 This is a closed book and closed notes exam. You are not allowed to use calculators or computers during this exam. Do ALL problems in this booklet. Read each question very carefully. You may detach pages, but you must return all pages of this exam. Name Email ID @iit.edu Do not place your social security number anywhere on this exam. Problem Points Score 1 6 2 4 3 4 4 4 5 6 6 2 7 4 8 6 9 4 10 4 11 4 12 6 13 6 14 6 15 6 16 6 17 6 Total 84 Percent 100
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 331 Midterm 2 Spring 2007 1 Doubly Linked Lists Question 1) (6 points) Making reasonable assumptions about the names and availability of member variables and constructors, write an insertBefore(Node n, E data) method that inserts a new data element before node n in a doubly-linked list. Question 2) (4 points) Give an operation that is O (1) for doubly linked lists, and is O ( n ) for singly linked lists.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern