previous | start | next

Answers

  1. Dropping the temp variable would not work. Then a[i] and a[j] would end up being the same value.

  2. 1 5
    4
    3
    2 6

    1 2 4
    3
    5
    6

    1 2
    3
    4
    5 6



previous | start | next