I am writing code to sort elements in list and I kind of achieved it but unable to stop while loop.
I want to stop while loop when all element in list are sorted.
[21, 22, 1, 11, 23, 0, 27] [21, 1, 11, 22, 0, 23, 27] [1, 11, 21, 0,
22, 23, 27] [1, 11, 0, 21, 22, 23, 27] [1, 0, 11, 21, 22, 23, 27] [0,
1, 11, 21, 22, 23, 27] [0, 1, 11, 21, 22, 23, 27] [0, 1, 11, 21, 22,
23, 27] [0, 1, 11, 21, 22, 23, 27]........
I know there are 10s of Q&A on sorting list but I want to achieve this way only(if possible).