click green flag to generate a random list, then have it sorted. In pseudocode Until the away is sorted Set i to 1 Until i = the length of the list Until item i is not > item i+1 Send item i to the end of the list Increase i by 1 Does this sorting algorithm already exist, or did I manage to invent a new algorithm?
This is a recreation of my first Python project. The original Python code for it is as follows: (there was also jank means of inputting a list at the start, but that is not part of the sorting algorithm proper) def checkIfSorted(): #Function for sort verification i = 0 while i < len(theList) - 1: if theList[i] > theList[i+1]: return True i = i + 1 return False while checkIfSorted(): #sort i = 0 while i < len(theList) - 1: while theList[i] > theList[i+1]: theList.append(theList[i]) theList.remove(theList[i]) i = i + 1 print(theList)