Question: Suppose we have a doubly-linked list class with this internal representation Node first; Node last; int sizei Suppose L is a linked list object. a.

 Suppose we have a doubly-linked list class with this internal representation

Suppose we have a doubly-linked list class with this internal representation Node first; Node last; int sizei Suppose L is a linked list object. a. Suppose that L.get (index) and L.set (index,obj) always go up the node chain from the beginning of the list. What is a simple, more efficient way of implementing get/set? b. Regardless of any changes made from part (a), what is so inefficient about execution of the following code? n -L.size)/2; if (L.get (n) .equals("AAA")) .set(n, "BBB" ) ; How could you effectively use an additional internal Node and an additional int data member to create a modification of get/set operations so to make them even more efficient

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!