Thank you everyone for your answers! Jimblumberg, i read the rules before posting a question, and i think it is not against the rules to post question about homework.

Anyway, this isn't actually any homerwork assignment, although it will be useful for college in the future. I tried to make the question as simple as possible. The array I want to sort is not that one, it is a very big array generated by my already big code that I need to organize so I can analyse it later. I was having serious difficulties sorting it.