Sorting alternating male and female
Can anyone suggest an algorithm to sort an array into althernating male and female? e.g.
Smith M
Smith F
Taylor M
Taylor F
The algorithm needs to disturb the list as little as possible so other criteria can also be used e.g. test scores. Also, it can't be exact because there is rarely exactly 50% of each.

