SortQueue Function
static void sortQueue ( ref Queue < int > q ) { for ( int i = 1 ; i <= q . Count ; i ++ ) { int min_index = minIndex ( ref q , q . Count - i ) ; insertMinToRear ( ref q , min_index ) ; } }