Given the following picture of a linked list, where Head and Ptr are of type LLNode<String>:
Write the code that will manipulate the linked list as follows. Each question should use the original list shown above.
a = new LLNode<Integer>(); a.setInfo(10); b = new LLNode<Integer>(); b.setInfo(20); a.setLink(b); c = new LLNode<Integer>(); c.setInfo(a.getInfo() + b.getInfo()); b.setLink(c); System.out.println(a.getInfo() + " " + c.getInfo() + " " + a.getLink().getInfo();
Email Me |
Office Hours |
My Home Page |
Department Home |
MCC Home Page
© Copyright Emmi Schatz 2012