Results 1 to 6 of 6

Thread: Size of a Tree

  1. #1

    Thread Starter
    Addicted Member MethadoneBoy's Avatar
    Join Date
    Oct 2001
    Location
    Preferably somewhere between Keira Knightley and Diane Kruger but I'm not fussy
    Posts
    180

    Size of a Tree

    Does anyone know what the 'size' of a Binary Tree is?

    By that I mean is it the number of nodes contained in it, or the height?

    I don't think it means the height of a tree but you never know...
    "'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."

  2. #2
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    I suppose size could mean almost anything. I think one important metric would be the number of bytes that comprise the tree, which should be the number of nodes times the number of bytes per node.

    cudabean

  3. #3
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    Size = depth of the tree in almost all the cases I have seen.

  4. #4

    Thread Starter
    Addicted Member MethadoneBoy's Avatar
    Join Date
    Oct 2001
    Location
    Preferably somewhere between Keira Knightley and Diane Kruger but I'm not fussy
    Posts
    180
    Well, I think the size has got something to do with the number of nodes as opposed to the memory that the Tree takes up.

    Last week we were asked to write a method that computed the height of a Tree and it seems strange that we would be asked to do it again.
    "'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."

  5. #5
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    i would go with number of nodes if it isnt the depth aka height.

  6. #6

    Thread Starter
    Addicted Member MethadoneBoy's Avatar
    Join Date
    Oct 2001
    Location
    Preferably somewhere between Keira Knightley and Diane Kruger but I'm not fussy
    Posts
    180
    Probably have to traverse the tree from left to right until you find the last node, then mark that as the deepest point.
    "'Oh, hello Mr. Crick! What do you think of Jeffrey Archer?' Clip-clip-clip! Oh, come on! Who are you kidding? You wait til I'm mayor, you'll see how tough I am! Christ almighty...."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width