Checking if List is Sorted
Procedure to check if a linked list is sorted or not.
Procedure :
Check if only one node is present. If so, return true.
Else, traverse through the list and check if the data of current node is greater than the data in the next node. If so, return false.
Return true if while loop is completely executed without returning false.
Contributed by Nitin Ranganath
Last updated