Solution Review: Check If List Is Sorted
Solution: Use a Loop
Use a while loop that iterates over the length of the list and checks if the previous element in the list is less than the next element. If so, a variable flag is set to true. If the flag is false, a list is sorted and vice versa.
The following illustrations explain the concept of sorting a list.
Case 1: If the list is sorted