Algorithm to check if a linked list is sorted

A linked list is a linear data structure in which the elements are not stored at contiguous memory locations like arrays but they are stored in random locations in heap memory because the memory for each node of the linked list has to be dynamically allocated and these nodes are connected to each other by links or reference.


In this article, we have explored an algorithm to check if a given Linked List is sorted or not in linear time O(N). It takes constant space O(1).


Structure of a node of our...
 •  0 comments  •  flag
Share on Twitter
Published on November 08, 2020 09:25
No comments have been added yet.