Click here to Skip to main content
15,894,180 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i am creating multi level binary tree project in asp.net. i have developed binary tree successfully till now. but i now i have to count pairs for particular user. suppose, one person registers two person under them that is called one pair. and if both registered persons also registers two and two under them.. then that is called three pairs. only what i want is how to count pairs under particular user???

Follow this article www.rajneeshverma.com/?tag=/Multi-level-marketing. I understand all the other things from that article but now understand how to count pairs.. Hope you understand my question now...
Posted
Updated 13-Feb-14 3:52am
v3
Comments
CHill60 13-Feb-14 8:19am    
Your question doesn't really make sense. Use the Improve question link to add a detailed explanation of where you are stuck
Harpreet_125 13-Feb-14 9:52am    
ZurdoDev 13-Feb-14 8:55am    
I have no ideas either. Actually, I do have one. Please explain more clearly what you are asking.
Harpreet_125 13-Feb-14 9:53am    
Hope you understand my question now...
ZurdoDev 13-Feb-14 9:54am    
Somewhat. But where are you stuck?

1 solution

Harpreet, I read all comments above.

I think you need to write a recursive function which will keep checking for children members available or not. Either you can implement Breadth Search or Depth Search Algorithms depending on your number of levels. (See Data Structure Algorithms for same).

Writing such method on UI is only advisable if you have Irrational Database (Objects), if you are thinking to get data from database. Then I would suggest you to write such functionality in database itself. (I had bad experience long back when I wrote such functionality in UI, but I was just college graduate and was not using Internet much :) )

-- Thanks Rushi
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900