upvote
"The children were sorted in to two lines by gender then ordered by height"

You might substitute "sorted by height" but its certainly not a correction. While "ordered into lines" would be an error.

reply
The sorting office for a postal service.
reply
What do you do when you sort your washing?
reply