Posted: Mon Jul 30, 2007 12:56 pm Post subject: Binary trees
Can abyone tell me when on on good time to use on on binary tree is?
Saad
Sponsor Sponsor
wtd
Posted: Mon Jul 30, 2007 2:03 pm Post subject: RE:Binary trees
Well, a binary tree is ideally balanced, and of course it's sorted.
So I'll answer your question with a question.
Inserting data into a binary tree is ____ and extracting data from a binary tree is ____?
Ultrahex
Posted: Mon Jul 30, 2007 3:53 pm Post subject: Re: Binary trees
funny thing is wtd, that i always put ruffles when people put ____s
so .... Inserting data into a binary tree is ruffles and extracting data from a binary tree is ruffles.
However, Inserting data into a binary tree is easy, fast, simple and extracting data from a binary tree is long and boring .
Unless I am mistaken, also the extracting data you have to look at which data you are extracting and depends on how your binary tree is setup also!
However, it is one of the many questions that has come up in Computer Science, and I am still unsure when a good time to use a Binary Tree would be, except in Graphing Information (Ex. collection of points that represent space-time, and want to insert a new point in middle) other then that I'm not sure what other times you would Actually Use in terms of Data Structure wise....
Hopefully wtd you can give a good example of when you would use a binary tree over another data structure. (I think that is what he is actually asking for)
rizzix
Posted: Mon Jul 30, 2007 4:51 pm Post subject: RE:Binary trees
Inserting and extracting (searching) in a binary tree are both O(log2 n) operations.
wensi
Posted: Sat Sep 01, 2007 10:06 am Post subject: Re: Binary trees
a100 @ Mon Jul 30, 2007 12:56 pm wrote:
wensi, why bother reading this?
why is ur signature like this? do i know u?
btw, all what i could think of now is that binary trees can be used for parsing arithmetic expression and used for BSP in 3D engines.
rdrake
Posted: Sat Sep 01, 2007 10:40 am Post subject: Re: Binary trees
wensi @ Sat Sep 01, 2007 10:06 am wrote:
a100 @ Mon Jul 30, 2007 12:56 pm wrote:
wensi, why bother reading this?
why is ur signature like this? do i know u?
He's using the [ username ] tag (aka the worst idea ever), it's not directed at you.
Saad
Posted: Sun Sep 02, 2007 5:44 am Post subject: RE:Binary trees
Sorry about the signature thing, I forgot to remove it and was on vacation.
wensi
Posted: Sun Sep 02, 2007 8:47 pm Post subject: RE:Binary trees