I have populate the hierarchy data in the following structure.
Screen shot:

In this i want to perform the sorting. In this case i have the flat data object for rendereing. For Expample. I have rendering object as like
renderedobjects=[ {1,...},{2,....} ...];
And also i have tried with sorting by looping the renderedobject and each object have Level property . but it take more time to perform rearrange the rendered objects . Is there any other way to perform this sorting.
Update Screen shots:
Screen shot 1:

Screen shot 2:

Screen shot 3:

Update: Hi if it is possible please share the algorithm for perform hierarchial data sorting based on the indent level using recursive functions