Question: 9. Assume the queue ADT is implemented using a singly linked list (enqueue operation puts item at the end of list; dequeue operation removes item
9. Assume the queue ADT is implemented using a singly linked list (enqueue operation puts item at the end of list; dequeue operation removes item from the front of list). What is the best run-time of the enqueue operation? a. O(N) d. O(N) 10. Assume the stack ADT is implemented using a singly linked list. The function reverseStack is implemented to pop the elements from the original stack S and push them into the reversed stack RS using push(RS, pop(S) What is the best run-time of the reverseStack function, if the original stacks has N elements? a. O(N) d. O(N')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
