Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: group based array sort

by bageler (Hermit)
on Feb 19, 2004 at 21:52 UTC ( #330372=note: print w/ replies, xml ) Need Help??


in reply to Re: group based array sort
in thread group based array sort

that's good and fine if the data came in the sorted tree order, which it doesn't in my situation. :-) think like pulling from a database, where the order is unknown and i'm not allowed to do ORDER BY in my sql.


Comment on Re: Re: group based array sort
Replies are listed 'Best First'.
Re: Re: Re: group based array sort
by Limbic~Region (Chancellor) on Feb 19, 2004 at 22:59 UTC
    bageler,
    While I really think using Sort::Tree is probably the best option, here is a purely iterative solution. It has the following requirements:
  • IDs will always be numerical
  • Root level nodes will always have a parent of 0
  • Probably a few others Cheers - L~R
      thanks! I'll give them both a shot.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://330372]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2015-07-31 12:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (277 votes), past polls