Data Structures and Algorithms
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
CHC5223 Data Structures and Algorithms
Assignment
Task 2
You must make appropriate use of assertions (assert statements) to protect preconditions of the
operations. Remember to enable assertion checking for your project.
You must give clear rationales and detailed explanations of your design and implementation in
the report.
2 mark
Task 3
You must make your class log monitoring information, either to a text file or by calls of
System.out.println.
It must log (at least):
• for every addition of a Member (put), for every retrieval of a Member(get), for every
deletion of a Member(remove):
3 of 15
o the sequence of nodes of the tree visited.
• Paste your log into your report.
We have supplied a main program CHC5223.java for your use with this assignment.
The name of the file is set in the static variable filename.
Sample files sampleMembersUK.csv and sampleMembersUS.csv each contain 500 members in
this format.
3 marks
You must give clear rationales and detailed explanations of your design and implementation in
the report.
3 mark
Task 4
You must devise a test plan for your implementation. Be sure to check (among many other
cases).
• that deleting a leaf node works correctly
• that deleting a node with one descendant works correctly
• that deleting a node with two descendants works correctly
2 marks
You must give clear rationales and detailed explanations of your design and implementation in
the report.
3 mark
Task 5
By using the supplied main program, or by other means, you must test your MemberBST.
You must give clear evidence and detailed explanations of your test in the report, including your
test plan, test data used, expected results and actual results. You must show your actual results
and the logging information copied from your log file or the output pane of your IDE. Do not
simply state “test passed”, or similar.
5 mark
Task 6
You must comment on the time efficiency and space efficiency of your implementation of the
binary search tree.
You must give clear rationales and detailed explanations in the report.
2 mark
4 of 15
Part B – graphs and pathfinding
The topic of this part of Assignment 2 is graphs and pathfinding.
General requirements
All your programming must conform to “Java Conventions and Programming Guidelines”.
You must paste the source code of all your classes into your report, as text, not images.
You must implement all necessary data structures using only arrays.
When programming in Java it is usual to make use of collection classes from the Java class library.
However, if you need to program in some other language such classes, or their equivalents, will
not necessarily be available.
Task 3
You must implement Java classes StackInt, QueueInt, ListInt and SetInt. These will be subclasses
respectively of abstract classes AbsStackInt, AbsQueueInt, AbsListInt, AbsSetInt, whose source is
provided and shown in the appendixes. These are given as abstract classes (to be ‘sub-classed’)
rather than as interfaces (to be ‘implemented’) partly because they are all ‘bounded’, that is,
with limited capacity because of being implemented by arrays, and also to allow us to give you
hints on how to implement them.