DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2007
    Posts
    11

    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?

  2. #2
    Join Date
    May 2007
    Posts
    843
    I odn't understand what u mentioned here.

    Please explain a bit otherwise we cannot help you.

  3. #3
    Join Date
    Aug 2007
    Posts
    11
    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.

  4. #4
    Join Date
    Dec 2003
    Posts
    3,366
    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

  1. Breadth First Searc
    By sundar divas in forum C++
    Replies: 19
    Last Post: 06-01-2007, 03:44 PM
  2. WshEnvironment: Path value
    By brouse in forum VB Classic
    Replies: 0
    Last Post: 08-03-2006, 03:26 PM
  3. ORA-00600: internal error
    By Lakshmanan in forum oracle.general
    Replies: 4
    Last Post: 04-06-2002, 02:19 AM
  4. They created J#, why couldn't they do VB#?
    By Thomas Eyde in forum .NET
    Replies: 290
    Last Post: 12-22-2001, 02:13 PM
  5. Virtual Path
    By Nate in forum Enterprise
    Replies: 0
    Last Post: 02-08-2001, 09:12 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links