Multiple Choice
You have implemented a queue as a singly-linked list, adding elements at the end and removing elements at the front.What is the cost of the add operation?
A) O(log n)
B) O(n)
C) O(n2)
D) O(1)
Correct Answer:

Verified
Correct Answer:
Verified
Related Questions
Q50: In the textbook implementation of the LinkedListIterator
Q51: Which of the following actions must be
Q52: A doubly-linked list requires that each node
Q53: Which of the following statements about adding
Q54: Given the partial LinkedList class declaration below,
Q56: Assume that you have a hash table
Q57: Which operations from the array list data
Q58: Given the partial LinkedList class declaration below,
Q59: On average, how many elements of an
Q60: Given the partial ArrayList class declaration below,