Binary search tree-need help with drawing

Reply

Join Date: Aug 2007
Posts: 18
Reputation: Ainur is an unknown quantity at this point 
Solved Threads: 0
Ainur Ainur is offline Offline
Newbie Poster

Binary search tree-need help with drawing

 
0
  #1
Aug 21st, 2007
Hi everybody

Hope you will help me with binary search tree task. I completely understand how to construct it with numbers, where the logic is that the left side must be less than right side, btu I didn't found anything how to draw the binary search tree generated from the input sentence.

In my task the sentence is "education is a monstrous waste of time". Do I need draw such as each smaller word must be on the left side of the bigger or how? If it is not so hard, please show me the example how to draw it. Thank you!!!
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 322
Reputation: Hamrick will become famous soon enough Hamrick will become famous soon enough 
Solved Threads: 33
Hamrick's Avatar
Hamrick Hamrick is offline Offline
Posting Whiz

Re: Binary search tree-need help with drawing

 
0
  #2
Aug 21st, 2007
Comparing letters depends on the relative value of the letters. But for character sets like ascii you say that A > Z, a > z, and Z > a. I'll attach a little program that can compare strings and tell you how they relate. I added the visual studio project too so you can see what the code does and modify it yourself if you want.
Attached Files
File Type: zip TextComparison.zip (40.7 KB, 23 views)
The truth does not change according to our ability to stomach it.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 18
Reputation: Ainur is an unknown quantity at this point 
Solved Threads: 0
Ainur Ainur is offline Offline
Newbie Poster

Re: Binary search tree-need help with drawing

 
0
  #3
Aug 21st, 2007
Dear Hamrick

Thank you a lot!
But in the book of Goldshlager I found that I have to draw this sentence in parsing structure. But still no idea how to do it
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2743 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Computer Science
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC