Name: ____________________________________________________ Alpha: _____________________
Describe help received: _________________________________________________________________
L and t, both of type
Node*, with the values depicted in the figure below:
|
On the picture:
|
|
|
|
|
|
| Draw a picture that depicts the code (like the picture in problem 2): |
Hint: Store the numbers in your linked list in reverse order
by calling add2front repeatedly (why will the list have reverse order?) as you read each
number in.
Example runs:
~/$ ./hw 7 2 8 -1 7 |
Hint 2: Don't hesitate to draw a picture of some small examples by
executing add2front() one by one.
|
~/$ ./hw 1 2 3 4 5 6 7 8 9 -1 7 ~/$ ./hw 4 8 2 7 4 9 -1 7
make hw compiles your source code into a program called
hw.
~/bin/submit -c=IC210 -p=hw31 Makefile *.cpp *.hIn the above
*.cpp means all the cpp files that you have in the
directory.