Computer Science Canada Binary trees |
Author: | Saad [ 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 |
Author: | wtd [ 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 ____? |
Author: | Ultrahex [ 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) |
Author: | rizzix [ 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. |
Author: | wensi [ 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. |
Author: | rdrake [ 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? |
Author: | Saad [ 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. |
Author: | wensi [ Sun Sep 02, 2007 8:47 pm ] |
Post subject: | RE:Binary trees |
its alright, its actually quite interesting ![]() |
: |