Question: Thanks! Q01. Suppose that a client performs a sequence of stack push and pop operations. The push operations put the integers through 9 in order

 Thanks! Q01. Suppose that a client performs a sequence of stack

Thanks!

Q01. Suppose that a client performs a sequence of stack push and pop operations. The push operations put the integers through 9 in order onto the stack; the pop operations print out the return values. Which of the following sequences - if any - could not occur? a. 21 4 3 6 5 8 790 b.46 8 753 2901 c. 256 748 9310 d. 1 2 3 4 5 6 9 8 70 e. 4 3 2 1 0 5 6 7 8 9 Q02. What does the following code fragment print when N is 43? Stack stack = new Stack(); while (N > 0) { stack.push (N % 2); N = N/2; } for (int d: stack) Stdout.print (d); Stdout.println(); a. 101010 b. 001011 c. 101000 d. 101111 e. 101011 Q03. The order of time complexity of enqueue-ing an element into a priority queue (with n elements): a. is independent of the particular implementation b. is O(1) for any implementation using ordered arrays c. is always O(nlogn) d. is always the same as the order of complexity of the dequeue operation e. none of the above Q04. Suppose x is a linked-list node and not the last node on the list. What is the effect of the following code fragment? x.next = x.next next; a. Deletes from the list the node immediately preceding x. b. Deletes from the list the node immediately following x. c. Deletes from the list the node following the node following x. d. Deletes from the list the node immediately following the node preceding x. e. Has no effect: neither deletes nor adds a node to the linked list

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!