Student DB output?

0 views
Skip to first unread message

Thomas Pantels

unread,
Oct 4, 2011, 8:24:08 PM10/4/11
to SJSUcmpe130
Hey guys, does the display of the database have to be in tree form?
like graphing output?
or is it just regular display like our lab 1 was? Prof. Lin what kind
of output do you prefer for
this lab?

Konstantin Vyshetsky

unread,
Oct 4, 2011, 8:28:31 PM10/4/11
to thomas...@gmail.com, SJSUcmpe130
I think trying to draw the tree in console is not practical and simply doing a post order output will not show you if you did the tree correctly or not. I ended up doing something like this:

Node:   22      Left:   NULL    Right: NULL     Top: 666
Node:   666     Left:   22      Right: 1111     Top: 3333
Node:   1111    Left:   NULL    Right: NULL     Top: 666
Node:   3333    Left:   666     Right: 5555     Top: NULL
Node:   4444    Left:   NULL    Right: NULL     Top: 5555
Node:   5555    Left:   4444    Right: 7777     Top: 3333
Node:   7777    Left:   NULL    Right: NULL     Top: 5555

This way can help debug and also show you if the tree is correct.
- Kon

prateek grover

unread,
Oct 4, 2011, 8:51:12 PM10/4/11
to kvysh...@gmail.com, thomas...@gmail.com, SJSUcmpe130
Not necessarily. My output is generated in a simple  (ID, "rest of the data" )format. To test if the tree is implemented properly, i followed the post order and compared it to the result i got by traversing it manually. The data i chose necessitated double and single rotation and wasn't quite so the testing was rather easy.
 

Thomas Pantels

unread,
Oct 4, 2011, 9:23:49 PM10/4/11
to SJSUcmpe130
Ok cool, ya your method of outputting Kon seems the most
practical, i think im gonna use it also if ya dont mind.
Reply all
Reply to author
Forward
0 new messages