Solved

binary search tree

Posted on 2004-04-17
3
195 Views
Last Modified: 2010-03-31
Hi, I have to implement this:
Say I am given a text,

why am fish, !
why do swim

I am to produce the following output using binary search tree.

am
do
fish
swim
why

Ok. My question. If i were to use the comparable interface, i do not need to use the euler's rule to traverse through the tree to print out the nodes in alphabetical order, right? So, how do i print it out?

0
Comment
Question by:shiehnee
3 Comments
 
LVL 30

Accepted Solution

by:
GrandSchtroumpf earned 50 total points
ID: 10852325
the comparable interface will help to fill your binary tree with the data.
i.e.: you save it to the left if smaller than parent node and to the right otherwise.
you'll fill your tree with all your data, and then you'll need to traverse it (left-to-right) to get your sorted output.  i don't know about the "euler's rule" for binary trees.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Checkbox and ListView in Android Layout 4 66
egit plugin on eclipse 8 63
Maven Project: Hibernate Dependencies Conflict 10 23
eclipse console opening separately 2 21
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question