what is wrong in this code?
Insertion sort in linked list
for input 2 1 3 4 5 I am getting output 1 2 4 3 5
once dry run on the same case. it is not performng insertion sort logic.
it is just swaping current data with prev of the list
what is wrong in this code?
for input 2 1 3 4 5 I am getting output 1 2 4 3 5
once dry run on the same case. it is not performng insertion sort logic.
it is just swaping current data with prev of the list