Starting from:
$30

$24

Homework Three Solution Comprehensive Recursion Exercises


Javadoc Standard Documentation *NOT* Required -- basic documentation is (all source files must include author name and a description of the class(es) contained in the file; any code another developer might not understand at first look should also be documented). Also, follow Java's naming conventions, utilize whitespace/indentation liberally in your code.




Purpose




The purpose of this assignment is to allow you to demonstrate knowledge of recursive programming. This assignment should be done by you without outside help (other than from your instructor).




Specifics




As defined in the MyLinkedList class, you have to use a dummy head node for the Linked List class.
Please implement two methods in the MyLinkedList class, 1) private MyLinkedList reverse(ListNode node); 2) private ListNode reverse(ListNode prev, ListNode subHead). The requirements and specifications for each method are provided in the comments above each method header. You are permitted to add helper methods into the class as needed.
You are NOT allowed to change or revise the provided AddFirst() and toString() methods in the MyLinkedList class.
You are NOT allowed to change the interface and signature (the list of arguments and their type, and return type) of the provided public methods in the MyLinkedList class.
Please implement another six methods in the Tester class as instructed by the comments on top of those method headers. You are permitted to add helper methods into the Tester class if needed.
You are NOT allowed to change the interface and signature (the list of arguments and their type, and return type) of the provided methods in the Tester class.
You are NOT allowed to change any code in the provided main() method and the init() method in the Tester class. However, during your testing and debugging, you can comment out some method calls in the main() of the Tester class in order to single out the method that you are currently debugging. After finish debugging, please make sure all methods are called (uncommented) in the main() of the Tester class, as it was initially provided by the instructor.
Please read and understand the design and implementation of the Tester class. So that you can imitate its design in other projects when perform testing.






List of methods you have to implement

In the MyLinkedList class

private MyLinkedList reverse(ListNode node)
private ListNode reverse(ListNode prev, ListNode subHead)



In the Tester Class

public int countSpace(String str)
public boolean myContains(String s1, String s2)
public int div(int m, int n) throws IllegalArgumentException
private boolean isSum24(int arr[], int targetSum)
private void reverseArray(int a[], int low, int high)
private void recursiveSelectionSort(int a[], int low, int high)



Rubrics:

Implementations of methods 1 through 8 above weigh 10% each. So it is 80% for all 8 method implementations.
A progress report for this assignment weights 20%. A progress report is a separate PDF file that will be due many days before the entire project is due. A separate assignment named hw3Progress will be created on canvas. Please turn in your progress report for this homework there. Please check the description of homework hw3Progress on Canvas for more details.



To Turn In

Turn in all your source code(.java file) on the EWU Canvas by going to CSCD300-01 course page on Canvas, then clicking Assignmentshw2-submit.




A progress report is a separate PDF file that will be due many days before the entire project is due. A separate assignment named hw3Progress will be created on canvas. Please turn in your progress report for this homework there. Please check the description of homework hw3Progress on Canvas for more details.







This assignment must be submitted in working order by the due data on the top of this assignment. Submit a zip file with your source files only. Source files are those that end in .java. Check your zip file before submitting and make sure it has only your source files. Do not submit .class files; they do the grader no good. You will not receive credit if your submission contains only .class files. Name your zip file with your last name, followed by the first initial of your first name, followed by hw3. For example, if you are John Smith, name you file as smithjhw3.zip.




The grader should be able to open your zip file, compile your code, and run your program from the command line using commands, javac *.java and java Tester version 1.7 or greater (so make sure you try this yourself before you submit). If your code has compile-time error when USING COMMAND LINE tool to compile, you get a ZERO for this homework! Therefore, please make sure you have NOT defined any java packages in your project, but have used the default java package.










Get started right away on this assignment or you WILL NOT finish :-(







CORRECT OUTPUT of the program is provided below.

---------Test Reverse()-------

{}

{C-B-A-D}

{A-B}

-------Test Reverse2()---------

{}

{C-B-A-D}

{A-B}

-------Test countSpace()----------

4

1

2

4

-----Test myContains()------------

true

false

true

true

-----Test div()------------

3

2

1

0

4

-----Test isSum24()------------

true

false

true

true

false

-----Test reverseArray()------------

[4, 3, 8, 3, 6]

[7, 6, 5]

[14, 10]

-----Test recursiveSelectionSort()------------

[3, 3, 4, 6, 8]

[1, 2, 3, 5, 6, 7, 8, 9]

More products