Due date: See Class Webpage
mkdir ~/cs255/pj9 cp /home/cs255001/Handouts/pj9/* ~/cs255/pj9 |
The List structure is as follows:
class List { int Value; <--- list elements ordered by this value List Next; } |
More details of the assignment are given below.
List InsertList(List head, List elem) { ... } |
The parameters are as follows:
|
The InsertList() function must return the address of the first element of the new list (= the list with the element inserted)
(I.e.: the parameters and the return value have the same meaning as the Insert() function discussed in this web page: click here
Requirement:
|
Develop your algorithm first
|
I have written a skeletal Java program that you can use to develop your recursive list insert algorithm. You should have copied this file in the preparation step above.
Use the file HelpList.java in your project directory and write a recursive InsertList( ) method in Java. You can compile and run the HelpList.java program and make sure that your InsertList( ) method in Java is correct first before you write your program in ARM assmbler - because debugging assembler code is much harder than Java code.
If the InsertList( ) algorithm is correct, the output of the HelpList.java program is:
List = 30 List = 30 50 List = 10 30 50 List = 10 30 40 50 List = 10 20 30 40 50 |
You can use this program test your project.
After you can written your InsertList function, you can compile the project using this command:
/home/cs255001/bin/as255 pj9.s InsertList.s |
Use Egtapi to run the pj9 program.
Correct behavior of the InsertList project:
|
|
|
Open EGTAPI's Terminal and type these command into the bottom terminal window:
cd ~/cs255/pj9 /home/cs255001/turnin InsertList.s pj9 // If you're in section 1 or /home/cs255002/turnin InsertList.s pj9 // If you're in section 2 |
You can also use the Turnin button in EGTAPI to turn in:
|
As usual, I want the source (so I can read it). DO NOT turn in the executable or the object code !
/home/cs255001/req-ext pj9 // If you're in section 1 or /home/cs255002/req-ext pj9 // If you're in section 2 |
You request will be successful if you have not exceeded the maximum number of "free" (no-questions-asked) requests allowed