-
Internal Path Length
Not to sound like a total moron, but is there a way to find the Internal Path Length using code? I am looking for a way to capture the count of all the internal nodes and their level to get the Internal Path Length, so I can in turn find the Average Path Length.
Any suggestions?
-
I odn't understand what u mentioned here.
Please explain a bit otherwise we cannot help you.
-
we are basically writing a program to take random numbers and build a binary search tree. I wanted to know if there is a way to capture the amount of internal nodes and the level each is on, so you can determine the Internal Path Length. Then I can the Average Path Length by dividing the IPL by the amount of records. I want to see if there was a way to capture this info.
-
Well, if its a search tree its balanced (or someone, somewhere is WRONG). If its balanced, the number of nodes tells you the average path length ... there is not much work to do, its a straight up computation. If for some insane reason its not balanced, you can do any of the standard tree traversals to generate a table of info that would let you compute this, but IMO your time would be better spent writing a better search tree.
Similar Threads
-
By sundar divas in forum C++
Replies: 19
Last Post: 06-01-2007, 03:44 PM
-
By brouse in forum VB Classic
Replies: 0
Last Post: 08-03-2006, 03:26 PM
-
By Lakshmanan in forum oracle.general
Replies: 4
Last Post: 04-06-2002, 02:19 AM
-
By Thomas Eyde in forum .NET
Replies: 290
Last Post: 12-22-2001, 02:13 PM
-
By Nate in forum Enterprise
Replies: 0
Last Post: 02-08-2001, 09:12 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks