
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Information about assignment 3 for cs122/504 computer programming ii course at pace university, spring 2006. Students are required to design and implement a linkedlistutility class with methods to create, reverse, print, and find the length of a linked list using node objects. The node class definition and assignment instructions.
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

Assigned on March 14, 2006 Due on April 11, 2006
public Node(int v, Node next) { this.v = v; this.next = next; } }
The class should support the following methods:
a. public Node makeList(int n); Return a linked list of n nodes, the first having value 1, the second having value 2, …, the last having value n. b. public int length(Node v); Return the length of a linked list with v pointing to its first node. c. public Node reverse(Node v); Reverse the order of the linked list with v pointing to its first node , and return the reference for the first node of the reversed linked list. d. public void print(Node v); Print in order the values of a linked list with v pointing to its first node.
Also write the main() method of the class to test out your LinkedListUtility class implementation.
The assignment is also posted in forum Assignments inside Discussion Board of CS122/ Blackboard. Submit a single source file as an attachment to your reply to my assignment 3 thread.
Please add assignment name, your name, your assignment completion date, and the above assignment problem description as comments at the beginning of your source code.
Please make sure that your program works correctly, and the source code is formatted properly with proper column alignment and line indentation. Add necessary concise comments to your tricky points for helping readers understand your program. There will be penalties for lacking necessary comments or improper code alignment or indentation.