Assignment FAQ Development Guide Code Checklist |
You should use this guide to help you to complete your assingment. You should follow it step by step, resolving errors before going on to the next step. Once you can follow this guide without errors, you should come up with more test cases and compare the output of your program with that of the solution.
% ./Driver -x
[Tree UCSDStudentTree - Allocating]
------------ TRACKED MEMORY ------------
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
Initial Symbol Table:
Tree UCSDStudentTree:
occupancy is 0 elements.
Please enter a command: ((a)llocate, , is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): a
Please enter name of new Tree to allocate: MyTree
[Tree MyTree - Allocating]
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): ^D
------------ TRACKED MEMORY ------------
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
Final Symbol Table:
Tree MyTree:
occupancy is 0 elements.
------------ TRACKED MEMORY ------------
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
% ./Driver -x
[Tree UCSDStudentTree - Allocating]
------------ TRACKED MEMORY ------------
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
Initial Symbol Table:
Tree UCSDStudentTree:
occupancy is 0 elements.
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): i
Please enter UCSD student name to insert: Angie
Please enter UCSD student number: 111
[Tree UCSDStudentTree - Inserting Angie]
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): w
------------ TRACKED MEMORY ------------
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
The Symbol Table contains:
Tree UCSDStudentTree:
occupancy is 1 elements.
at height: 0 with balance: 0 name: Angie studentnum: 111
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): i
Please enter UCSD student name to insert: Alvin
Please enter UCSD student number: 222
[Tree UCSDStudentTree - Comparing Alvin and Angie]
[Tree UCSDStudentTree - Inserting Alvin]
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): w
------------ TRACKED MEMORY ------------
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
The Symbol Table contains:
Tree UCSDStudentTree:
occupancy is 2 elements.
at height: 0 with balance: 0 name: Alvin studentnum: 222
at height: 1 with balance: 1 name: Angie studentnum: 111
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): i
Please enter UCSD student name to insert: James
Please enter UCSD student number: 333
[Tree UCSDStudentTree - Comparing James and Angie]
[Tree UCSDStudentTree - Inserting James]
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): w
------------ TRACKED MEMORY ------------
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
The Symbol Table contains:
Tree UCSDStudentTree:
occupancy is 3 elements.
at height: 0 with balance: 0 name: Alvin studentnum: 222
at height: 1 with balance: 0 name: Angie studentnum: 111
at height: 0 with balance: 0 name: James studentnum: 333
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): i
Please enter UCSD student name to insert: Richard
Please enter UCSD student number: 5
[Tree UCSDStudentTree - Comparing Richard and Angie]
[Tree UCSDStudentTree - Comparing Richard and James]
[Tree UCSDStudentTree - Inserting Richard]
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): i
Please enter UCSD student name to insert: Phillip
Please enter UCSD student number: 9999
[Tree UCSDStudentTree - Comparing Phillip and Angie]
[Tree UCSDStudentTree - Comparing Phillip and James]
[Tree UCSDStudentTree - Comparing Phillip and Richard]
[Tree UCSDStudentTree - Inserting Phillip]
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): w
------------ TRACKED MEMORY ------------
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
The Symbol Table contains:
Tree UCSDStudentTree:
occupancy is 5 elements.
at height: 0 with balance: 0 name: Alvin studentnum: 222
at height: 3 with balance: -2 name: Angie studentnum: 111
at height: 2 with balance: -2 name: James studentnum: 333
at height: 0 with balance: 0 name: Phillip studentnum: 9999
at height: 1 with balance: 1 name: Richard studentnum: 5
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): ^D
------------ TRACKED MEMORY ------------
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
Final Symbol Table:
Tree UCSDStudentTree:
occupancy is 5 elements.
at height: 0 with balance: 0 name: Alvin studentnum: 222
at height: 3 with balance: -2 name: Angie studentnum: 111
at height: 2 with balance: -2 name: James studentnum: 333
at height: 0 with balance: 0 name: Phillip studentnum: 9999
at height: 1 with balance: 1 name: Richard studentnum: 5
% ./Driver -x
[Tree UCSDStudentTree - Allocating]
------------ TRACKED MEMORY ------------
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
Initial Symbol Table:
Tree UCSDStudentTree:
occupancy is 0 elements.
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): i
Please enter UCSD student name to insert: Brandon
Please enter UCSD student number: 222
[Tree UCSDStudentTree - Inserting Brandon]
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): i
Please enter UCSD student name to insert: Zachary
Please enter UCSD student number: 333
[Tree UCSDStudentTree - Comparing Zachary and Brandon]
[Tree UCSDStudentTree - Inserting Zachary]
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): i
Please enter UCSD student name to insert: Matt
Please enter UCSD student number: 444
[Tree UCSDStudentTree - Comparing Matt and Brandon]
[Tree UCSDStudentTree - Comparing Matt and Zachary]
[Tree UCSDStudentTree - Inserting Matt]
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): w
------------ TRACKED MEMORY ------------
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
The Symbol Table contains:
Tree UCSDStudentTree:
occupancy is 3 elements.
at height: 2 with balance: -2 name: Brandon studentnum: 222
at height: 0 with balance: 0 name: Matt studentnum: 444
at height: 1 with balance: 1 name: Zachary studentnum: 333
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): l
Please enter UCSD student name to lookup: Matt
[Tree UCSDStudentTree - Comparing Matt and Brandon]
[Tree UCSDStudentTree - Comparing Matt and Zachary]
[Tree UCSDStudentTree - Comparing Matt and Matt]
Student found!
name: Matt studentnum: 444
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): l
Please enter UCSD student name to lookup: Adam
[Tree UCSDStudentTree - Comparing Adam and Brandon]
student Adam not there!
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): l
Please enter UCSD student name to lookup: Dylan
[Tree UCSDStudentTree - Comparing Dylan and Brandon]
[Tree UCSDStudentTree - Comparing Dylan and Zachary]
[Tree UCSDStudentTree - Comparing Dylan and Matt]
student Dylan not there!
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): ^D
------------ TRACKED MEMORY ------------
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
Final Symbol Table:
Tree UCSDStudentTree:
occupancy is 2 elements.
at height: 2 with balance: -2 name: Brandon studentnum: 222
at height: 0 with balance: 0 name: Matt studentnum: 444
at height: 1 with balance: 1 name: Zachary studentnum: 333
No memory leaks! All memory has been correctly deallocated.
% ./Driver -x
[Tree UCSDStudentTree - Allocating]
------------ TRACKED MEMORY ------------
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
Initial Symbol Table:
Tree UCSDStudentTree:
occupancy is 0 elements.
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): r
Please enter UCSD student name to remove: Angie
student Angie not there!
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): i
Please enter UCSD student name to insert: Angie
Please enter UCSD student number: 111
[Tree UCSDStudentTree - Inserting Angie]
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): i
Please enter UCSD student name to insert: James
Please enter UCSD student number: 222
[Tree UCSDStudentTree - Comparing James and Angie]
[Tree UCSDStudentTree - Inserting James]
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): r
Please enter UCSD student name to remove: Angie
[Tree UCSDStudentTree - Comparing Angie and Angie]
Student removed!
name: Angie studentnum: 111
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): r
Please enter UCSD student name to remove: James
[Tree UCSDStudentTree - Comparing James and Angie]
[Tree UCSDStudentTree - Comparing James and James]
Student removed!
name: James studentnum: 222
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): r
Please enter UCSD student name to remove: Angie
[Tree UCSDStudentTree - Comparing Angie and Angie]
student Angie not there!
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): r
Please enter UCSD student name to remove: James
[Tree UCSDStudentTree - Comparing James and Angie]
[Tree UCSDStudentTree - Comparing James and James]
student James not there!
Please enter a command: ((a)llocate, is(e)mpty, (i)nsert, (l)ookup, (r)emove, (w)rite): ^D
------------ TRACKED MEMORY ------------
40 bytes of heap memory, created in main calling Tree Ctor for the Tree object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
24 bytes of heap memory, created in main calling UCSDStudent Ctor for the UCSDStudent object.
48 bytes of heap memory, created in Tree.insert calling TNode Ctor for the TNode object.
Final Symbol Table:
Tree UCSDStudentTree:
occupancy is 0 elements.
No memory leaks! All memory has been correctly deallocated.
% ./Calc [-x]
Note that, in order for your homework to be collected correctly, you must name your files Tree.java and Driver.java and the files must be located in a folder called hw7 in your home directory.
Assignment FAQ Development Guide Code Checklist |