It is practically impossible to teach good programming style to students that have had prior exposure to BASIC. As potential programmers, they are mentally mutilated beyond hope of regeneration. E. W. Dijkstra

Merge sort using linked list

Language Java | Level Intermediate | Category Data structure | August 30, 2015 5:37 pm


Data structure Description

Merge sort is a comparison-based sorting algorithm. It uses divide and conquer logic to sort the items. Linked list is a data structure. Each record of a linked list is called as the node. The field of each node that contains the address of the next node.

Write a program to implement Merge sort using linked list.


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.