# Past Exam for COMP 385 - DATA STRUCTURES II at Wentworth Institute of Technology (WIT)

## Exam Information

 Material Type: Mid-Term Professor: Staff Class: COMP 385 - DATA STRUCTURES II Subject: Computer Science University: Wentworth Institute of Technology Term: -- Keywords: Either...orDoubly Linked ListFunctionalityThe MessageLinked ListProfessionalIn Front OfIn Front (of)Data Structures

## Sample Document Text

NAME___________________________________________________ Wentworth Institute of Technology Division of Professional and Continuing Studies COMP385 Section 71 - Data Structures II - Fall, 2005 P1 P2 Total Midterm – Open Book 1. Write a loop that iterates Backward over an LinkedList collection of Strings. Use the methods previous and hasPrevious() to construct the loop. 2. Add the appropriate items to the below diagram to make it into a Doubly Linked List (ie add the missing fields and missing arrows and indicators of the front and rear of the list) 3. Given the following recursive definition of a function: f(n) = 0 for n=0 f(n) = f(n/2) if n is even f(n) = 1+f(n-1) if n is odd What are the values of f(1)_______________________________ f(2)_______________________________ f(3)_______________________________ f(7) ______________________________ f(8)_______________________________ 4. a. What operation is EASY to do for an array-based list, but is hard to do with Linked? Why? b. What operation is EASY to...