Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves. Alan Kay

Insert sorted linked list

Language Java | Level Intermediate | Category Data structure | September 5, 2015 10:24 pm


Data structure Description

Write a program to insert the new element in the sorted linked list.

If the element has high or low value, it should insert appropriate place in sorted linked list. Linked list has the only address of next node. Whenever to insert a new element in the linked list, the list should able to sort and insert to the appropriate location.


Output

   					 

Insert items in LinkedList:9
Insert items in LinkedList:43
Insert items in LinkedList:34
Insert items in LinkedList:11
Insert items in LinkedList:78
Insert items in LinkedList:55
Sort items in LinkedList:9->11->34->43->55->78->NULL

				    

Comments


No comments available!

Please login to add comments.