Click here to Skip to main content
15,888,454 members

Comments by JoePatent (Top 1 by date)

JoePatent 13-Sep-11 14:03pm View    
Deleted
1-The datasource should be sort not the tree in asp.net. And then you fill the tree...
2- recursive function should always be avoid in prod development. This could be the source of instability. You can't predict the number of iteration and consequently the resources that will be required to run your routine.
3- foreach (TreeNode n in node.ChildNodes)
if (temp == null || n.Text[0] < temp.Text[0])
temp = n;
This need explanation. As soon as your temp is null you should not even execute your for each loop. That's a waste of time.
4-Also, there is already existing sort algorithm to accomplish this without having to code yourself an average one like this one based on bubble sort algo.