Click here to Skip to main content
15,885,365 members
Home / Discussions / C#
   

C#

 
GeneralRe: Last grandchild of a node in a tree [modified] Pin
devboycpp23-Oct-09 0:46
devboycpp23-Oct-09 0:46 
GeneralRe: Last grandchild of a node in a tree Pin
dan!sh 23-Oct-09 1:11
professional dan!sh 23-Oct-09 1:11 
GeneralRe: Last grandchild of a node in a tree Pin
devboycpp23-Oct-09 2:47
devboycpp23-Oct-09 2:47 
GeneralRe: Last grandchild of a node in a tree Pin
dan!sh 23-Oct-09 3:55
professional dan!sh 23-Oct-09 3:55 
GeneralRe: Last grandchild of a node in a tree Pin
devboycpp23-Oct-09 5:51
devboycpp23-Oct-09 5:51 
GeneralRe: Last grandchild of a node in a tree Pin
ely_bob23-Oct-09 6:50
professionalely_bob23-Oct-09 6:50 
GeneralRe: Last grandchild of a node in a tree Pin
devboycpp23-Oct-09 6:57
devboycpp23-Oct-09 6:57 
GeneralRe: Last grandchild of a node in a tree [modified] Pin
ely_bob23-Oct-09 7:50
professionalely_bob23-Oct-09 7:50 
here is an approximation since I don't know your exact structure:

<pre>

class address
{
      list<int> token;

}

list<address> addresses = Tree.MapAddress();
int generation =0;
for(int i=0;i < addresses.Count-1;i++)
{
   if(addresses[i+1].token[generation] > addresses[i].token[generation])
   {      Console.Writeline("Your function result Here");}            }
}

</pre>


Now I had some wonky recursion like I would need to skip children(closed leaf) and step into/out of children so you can navigate (almost as fast) using the address and recursion... but it takes a LOT of code. this is the smallest patch I can think of for your situation.


also you can change the generation by swapping out the generation number so if you wanted the line between great grand children and grand children switch 0->1, and voila.

Poke tongue | ;-P

modified on Friday, October 23, 2009 2:01 PM

GeneralRe: Last grandchild of a node in a tree Pin
devboycpp23-Oct-09 8:17
devboycpp23-Oct-09 8:17 
GeneralRe: Last grandchild of a node in a tree Pin
ely_bob23-Oct-09 8:26
professionalely_bob23-Oct-09 8:26 
QuestionHow to check status file Pin
Dedy Hartono22-Oct-09 22:59
Dedy Hartono22-Oct-09 22:59 
AnswerRe: How to check status file Pin
Christian Graus22-Oct-09 23:24
protectorChristian Graus22-Oct-09 23:24 
AnswerRe: How to check status file Pin
dan!sh 22-Oct-09 23:37
professional dan!sh 22-Oct-09 23:37 
GeneralRe: How to check status file Pin
Christian Graus22-Oct-09 23:39
protectorChristian Graus22-Oct-09 23:39 
GeneralRe: How to check status file Pin
dan!sh 22-Oct-09 23:58
professional dan!sh 22-Oct-09 23:58 
GeneralRe: How to check status file Pin
Christian Graus23-Oct-09 0:09
protectorChristian Graus23-Oct-09 0:09 
QuestionRegarding the dll Pin
Sasmi_Office22-Oct-09 22:45
Sasmi_Office22-Oct-09 22:45 
AnswerRe: Regarding the dll Pin
Vimalsoft(Pty) Ltd22-Oct-09 23:52
professionalVimalsoft(Pty) Ltd22-Oct-09 23:52 
QuestionForm Invisible and Cpu up to 50% Pin
Escocia22-Oct-09 21:51
Escocia22-Oct-09 21:51 
AnswerMessage Closed Pin
22-Oct-09 21:56
stancrm22-Oct-09 21:56 
GeneralRe: Form Invisible and Cpu up to 50% Pin
Escocia22-Oct-09 22:45
Escocia22-Oct-09 22:45 
GeneralMessage Closed Pin
22-Oct-09 23:10
stancrm22-Oct-09 23:10 
GeneralRe: Form Invisible and Cpu up to 50% Pin
Christian Graus22-Oct-09 23:25
protectorChristian Graus22-Oct-09 23:25 
AnswerRe: Form Invisible and Cpu up to 50% Pin
Christian Graus22-Oct-09 22:05
protectorChristian Graus22-Oct-09 22:05 
GeneralRe: Form Invisible and Cpu up to 50% Pin
Escocia22-Oct-09 22:57
Escocia22-Oct-09 22:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.