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!!!

Recommended Answers

All 2 Replies

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. :)

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:(

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.