Jump to content

Order Array in Binarry tree represantation

- - - - -

  • Please log in to reply
1 reply to this topic

#1
toto_7

toto_7

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 295 posts
Hello,
im confused, how we starting when we have an orded array and we want to represent it in binary tree?
Example : Array(A):{1,2,3,4,5,6,7,8,9}
Starting from first element, or from middle?

"Programming is like sex. One mistake and you have to support it for the rest of your life."

-Michael Sinz

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
It depends on what type of encoding you want to use. Does it matter if the tree is balanced? Do you intend to recurse the tree using depth first search or breadth first search?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users