Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439
COMP9024 Practice Assignment-1: Implement a new ADT using the class library COMP9024 Data Structures and Algorithms Session 2, 2010 Practice Assignment 2:  Implement new methods for an existing ADT   Please note that you must do this practice assignment in order to learn and acquire the required problem solving skills for the course. Some of the questions in the mid-session exam and the final exam will be based on the exercises in this assignment.  Please contact your lecturer if you have any problems, and also to receive feedback on your programming style and problem solving approaches.  Aim: To understand how to deal with dynamic structures in Java, and to extend the doubly linked list class given in the textbook. Task: In this practice assignment, you will extend the doubly linked list class given in the textbook Chapter (3.17 DNode-Node, 3.22 DList-Header ,  3.23 DList-Trailer , 3.24 DList-Conv). The subclass is named MyDlist. You need to implement the following constructor and methods of MyDlist:   1.     public MyDlist(). This constructor creates a doubly linked list by reading all strings from the standard input. Assume that each input line is a string and an empty line denotes end of input.   This constructor creates an empty list. (To simplify the task, I have now revised this specs).   2.     public MyDlist(String f). This constructor creates a doubly linked list by reading all strings from a file f. Assume that adjacent strings in the file f are separated by one or more white space characters.   3.     public void printList(). This instance method prints all elements of a list on the standard output, one element per line.   4.     public static MyDlist cloneList(MyDlist u). This class method creates an identical copy of a doubly linked list u and returns a reference to the resulting doubly linked list.   5.     public static MyDlist concatenateList(MyDlist u, MyDlist v). This class method concatenates two doubly linked lists u and v into a single doubly linked list and returns a reference to the resulting doubly linked list. In the resulting doubly linked list, the linked list u precedes the linked list v.   1.    public void removeNode(String e). This instance method removes all the nodes that contain the string e. If no node of the list contains e, this method will print “ no node contains e!” on the standard output.     Testing your ADT: You should test your implementation using a variety of inputs. The aim should be to test your implementation for common as well as uncommon cases. Please read the section on "Testing and Debugging" in the textbook.    -- end --