Modifying the Hierachy or GameObject in the Hierachy

I want to know if there anyway that i can get all of the object in the hierachy and if it possible to modify how the hierchy looks for effiecnncy and something i’m working on
Please state the classes or function that can allow me to modifiy the hierachy or all the gameobject in the hierachy. I already know of BaseHierachySort o if there any others y yuo know can you tell me please
Thank for aswering ahead of time

All functions for working with hierarchy are incapsulated in Transform class.