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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!