|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
How Implement Binary Tree Nodes Counting?
Dear Friends,
I need to find the total number of nodes in a binary tree structure, Also need the the leftside and right side separately. Please help us. Also Please check the attachments. Attachment contains database structure and Binary Tree Structure. with regards Subhash |
|
#2
|
||||
|
||||
|
do you need to do this with queries only?
do you just want the number of nodes? then there queries should work? Code:
'--> total number of nodes select count(*) - 1 from nodeTable '--> total number of left nodes select count(*) from nodeTable where leftid is not null '--> total number of right nodes select count(*) from nodeTable where rightid is not null hope this helps
__________________
Look! Its a ShemZilla ![]() ![]()
|
|
#3
|
|||
|
|||
|
Hi friend,
I am using ASP for implementing this program, Yes i need find the total number of sub nodes( left and right ) in a particular node. I attached the database structure and pictorial representation of nodes in database. Please check it. I need the sql query that implementing the program. 1. Find the total number of subnodes of a particular node. 2. Find the total number of left handside nodes of a particular node. 2. Find the total number of right handside nodes of a particular node. Please give me the idea. warm regards Subhash |
|
#4
|
|||
|
|||
|
Hi Subhash,
Am also facing this problem...
Hope you can help me.... I have to implement MLM using sql-2000.. Please tell me the query of how to get the sub nodes of any given nodes....if not query then tell me in any other programmin language.... I am working on C#/ASP.NET. Quote:
|
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > How Implement Binary Tree Nodes Counting? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|