I have below code it will fetch the category as well as subcategory from Magento.
The Problem is that I have around more then 300
subcategory. So I can not change the manually in Magento
I need to a sort category based on Name.
For Example I have attach the Image