Question: Please answer these multiple choice questions. 22. - 25. Answer questions about the following code: Deque d1= new ArrayDeque >(), d2 = new ArrayDeque ();

Please answer these multiple choice questions.

Please answer these multiple choice questions. 22. - 25. Answer questions about

the following code: Deque d1= new ArrayDeque >(), d2 = new ArrayDeque

22. - 25. Answer questions about the following code: Deque d1= new ArrayDeque >(), d2 = new ArrayDeque (); for (char c: "HELLO". toCharArray ()) \{ d1. push(c); \} for (char c: "GOODBYE", toCharArray ()) \{ d2 add(c); \} while (!d2, isEmpty ()) \{ System, out, print (d2, remove ()); \} Name: 22. Which of the following data structures can implement a queue? You can choose more than one. (a) ArrayList (c) List (e) ArrayDeque (b) LinkedList (d) TreeSet 23. In the code above, which object is a queue? (a) d1 (b) d2 24. After the code has completed up to line 10 , what is at the head of d2 ? (a) ' G ' (c) 'B' (b) ' O ' (d) ' E ' 25. What is the output of the code on lines 12-14? (a) EYBDOOG (c) GOODBYE (b) BEDGOOY (d) EYBDOG

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!