Average Height of a binary tree
From: Pea Buddy (pea_at_hotmail.com)
Date: 02/07/04
- Next message: Bill Rosgen: "Re: Average Height of a binary tree"
- Previous message: manicmarvin: "Re: The Dialogue of Existence"
- Next in thread: Bill Rosgen: "Re: Average Height of a binary tree"
- Reply: Bill Rosgen: "Re: Average Height of a binary tree"
- Reply: Engr Bohn: "Re: Average Height of a binary tree"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 07 Feb 2004 19:49:44 GMT
In the book, "Introduction To Algorithms" by Cormen, Leiserson, Rivest, it
says that the average height of a randomly built binary search tree on n
distinct keys is O(lg n). pg.258. However, If you have 7 nodes for example,
lg 7 is 2.8. But that is impossible since the shortest height would is 3.
What is wrong?
lg n = log_base2 n
- Next message: Bill Rosgen: "Re: Average Height of a binary tree"
- Previous message: manicmarvin: "Re: The Dialogue of Existence"
- Next in thread: Bill Rosgen: "Re: Average Height of a binary tree"
- Reply: Bill Rosgen: "Re: Average Height of a binary tree"
- Reply: Engr Bohn: "Re: Average Height of a binary tree"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]