Question: As a preparation for this lab it would be a good idea to review your code for your LinkedStack andLinkedQueue classes 1. Hand trace an
As a preparation for this lab it would be a good idea to review your code for your LinkedStack andLinkedQueue classes 1. Hand trace an ordered list X through the following operations. Operation X.add(new Integer(4) X add (new Integer(7) Object Y X.first0) Kadd(newlnteger(3))i X.add(new Integer(2): X.add(new Integer(5)) Object Y = X. removeLasto Object Y X.remove(new Integer/7): X.add(new Integer(9) List 2. Given the resulting list X from Exercise 1, what would be the result of each of the following? Operation Result z = x.contains(new Integer(3)); X.f Y X.remove(new Integer(2)); X.f 3. What would be the time complexity of the size operation for the linked implementation if there were not a count variable? 4. In the linked implementation, under what circumstances could the head and tail references be equal
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
