Question: (30%) This question concerns the Singly Linked List (SLL) with a head pointer but no tail pointer. Suppose the following recursive method is implemented inside

 (30%) This question concerns the Singly Linked List (SLL) with a

(30%) This question concerns the Singly Linked List (SLL) with a head pointer but no tail pointer. Suppose the following recursive method is implemented inside the SLL class (hence, it has access to its private members) and modifies an instance SLL in some specific way that you will need to figure out below. public static Node modifySLL( Nodep) { if (p == null || p.getNext() == null) return null; Node q = p.getNext(); p.setNext( modifySLL(q)); return; a) (10%) What would be the result of applying the instruction Node h2 = modifySLL( h1 ); on the SLL below? Draw a diagram of the resulting state of the data. In that diagram also clearly show where h1 and h2 point to. ht > > >>> > > >nul

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!