3. Insert in a Sorted List
Given a sorted singly linked list and a data, your task is to insert the data in the linked list in a sorted way i.e. order of the list doesn't change.
Example 1:
Example 2:
Solution:
Edge case: Insertion in start Insertion in end
Time Complexity: O(n)
Last updated
Was this helpful?