![]() |
VOOZH | about |
Given a linked list sorted in ascending order and an integer called key, insert data in the linked list such that the list remains sorted.
Input: Linked List: 25->36->47->58->69->80, key: 19
Output: 19->25->36->47->58->69->80
Explanation: After inserting 19 the sorted linked list will look like the one in the output.
👁 420047172Input: Linked List: 50->100, key: 75
Output: 50->75->100
Explanation: After inserting 75 the sorted linked list will look like the one in the output.
👁 420047174
19 25 36 47 58 69 80