Computer Science Canada Help needed regarding binary trees |
Author: | A.J [ Mon Feb 04, 2008 1:41 pm ] | ||
Post subject: | Help needed regarding binary trees | ||
I needed to know how to initialize a binary tree on turing. This is what i know so far
but i do not know how to initialize the tree (like for example set 'A' as the root then set 'B' and 'C' as the children of 'A' and so on...) so if anyone could help me , that will be great. I also attached a program (and the file it reads from) making a binary heap stored on an array (see http://en.wikipedia.org/wiki/Binary_heap for more detail on what I have done) but it creates the heap for a list of 100000 numbers (on the text file) in approx. 5 seconds. Is there a faster method? |
: |