Skip to content

Commit

Permalink
Update Tree.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
Wordluc authored May 1, 2024
1 parent 858ade6 commit 0e36a69
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Tree.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,15 @@ Ff GetOrderedListFromTree(node,i,list){
GetListFromTree(node[0],i,list);
}
list[i[0]]=node[1];
//utilizzo l'array con l'elemento i in modo da passare l'indice come reference, sfruttando le slice di golang

i[0]=i[0]+1;

if(node[2]!=nil){
GetListFromTree(node[2],i,list);
}
}
let list=[22,21,6,7,9,0,55,6,-20,88,99];
let node=MakeTree(list);
let orderedList=FromTreeToList(node,len(list));

END

0 comments on commit 0e36a69

Please sign in to comment.