Assume that 1 items are not sorted in any way 2 the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: own , E item); p ublic a bstract E g etDatum(LRStruct<E> own ); p ublic a bstract L RStr uct<E > setRest(LRStruct<E> own , LRStruct<E> rest); p ublic a bstract L RStruct<E> getRest(LRStruct<E> own); p ublic a bstract < I,O> O execute(IAlgo<I,E,O> algo, LRStruct<E> host, I arg); } } 2 [ CSE116 – EXAM 2 – VERSION 1 ] FALL 2011 Question 2 [10 marks] Part a [6 marks – 2 each] For each of the following operations, state whether an array ­based or a singly ­ linked list would be more (time) efficient; if they are just as efficient, say so. Assume that (1) items are not sorted in any way, (2) the order of items in the list must be maintained, and (3) the linked list only maintains a reference to the head of the list, not the tail. Justify your answer in each case. insert an item at the front of the list insert an item at the back of the list...
View Full Document

Ask a homework question - tutors are online