Better node sorting algorithm for schoolwork

This was a practice assessment that already happened, and whilst I was proud that I thought of something complication yet works, I think that there are probably issues, because the idea itself is quite cursed. The idea was to make a bird orginizing tool, and there is supposed to be pre-existing data from a json file, here is the sorting function I made, its supposed to count the amount of refrences each bird made to a taxonomic grouping, and the more refrences means the higher the node, and with some algorythim is kinda sorted it, but it doesnt seem efficent enough, I am looking for ideas on how to improve, here it is:

full code:

json:

Wow. That is a horrible website. Please use the Rust Playground instead.

You wont be able to run it in there as it expects a file, you could replace it with pre-existing json, derived from what I put in one of the pastebins.

1 Like