In: Computer Science
a.LinkedList < T > and ArrayList
< T > are interfaces
b.List < T > is a concrete class
c.LinkedList < T > and ArrayList< T > are concrete
classes
d.List < T > is an interface
enqueue 'a'
enqueue 'b'
enqueue 'c'
dequeue
dequeue
What remains in the queue after these operations complete?
a. 'a'
b. 'a', 'b'
c. 'b', 'c'
d. 'c'
push 'a'
push 'b'
pop
peek
push 'c'
pop
What value(s) is/are on the stack after these operations are complete?
a. 'a', 'b', 'c'
b. 'a', 'b'
c. 'c'
d. 'a'
a. O(1), O(log n), O(n), O(n ^
2)
b. O(n log n), O(n), O(1), O(log n)
c. O(log n), O(n), O(n log n), O(n ^ 2)
d. O(l), O(n), O(n ^ 2), O(n ^ 3)
a. binary search of a sorted array is
O(log n)
b. linear search of an array is O(n)
c. traversing a linked list is O(n)
d. adding an element to the end of an arraylist that has available
space is O(n)