Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

FinalExam Review Spring2007: Draw the Tree

Back to Final Review-Spring 2007

Questions? Answers? Comments?

root ——–branch1——-("is"+"snap")
' '——————–("snap"+"clave")
' '——————–("is"+"is")
'—————-scaled branch(2.0)
' '————–(clave + gong)
' '————–(chirp + clap)
'————————-scaled branch(0.5)
' '————-("is"+"gong")
'———————-branch 2
'————–(clap +clave)

that did not show up right. well all the once after two cotations has to move underneath the branch1 or scaled branch (2) or scaled branch (0.5) or branch 2.(for the last one all go under the branch 2).


take a look a the bitmap and let me know if it works...

I think this diagram below is pretty accurate. However, when you have like "guzdial, is, snap" I think they're supposed to have a next between them. For instance, "guzdial" next -> "is" next -> "snap". I think it is supposed to be this way because they are appended to each other ( as a linked list) and so they know they're next (remember SongNode?). I hope someone can tell me if this is correct.

should children(in each branch) be connected with arrows?

one problem with the diagram: scaledBranch(0.5) is a child of branch1, not of root.. and all the other branches are children of root, and should be displayed that way i think.. the way i have it set up is root is the main center, with branch1, scaledBranch(2.0), and branch2 as children, branch1 being far left with its 4 children (counting scaledBranch(0.5)), with a next going from scaledBranch to scaledBranch, and a next going from "rest chirp clap" child of scaledBranch(2.0) to branch2.. i don't know if thats 100% correct, but whatever.

So this tree can have multiple branches? We are not asked to create a binary tree unless specified, correct?

ah i was looking at the actual method in the java source; that one says that the second scaled branch is a child of branch1. i opened that one in dr java and looked at it from there. from the code here, the guy above is correct. thanks for stressing the NOT to make me make sure :)

Uploaded Image: DrawtheTree.JPG

Link to this Page