Merge sort, Data Structure & Algorithms

Merge sort is a sorting algorithm which uses the basic idea of divide and conquers. This algorithm initially divides the array into two halves, sorts them separately and then merges them together again. This method is recursive, with the base criterion-the number of elements in the array is not more than 1. Let us suppose variable low and high represents the index of the first and last element of the array respectively, the merge sort can be defined recursively as follows

If(low

Divide the list into two halves Mergesort the left half Mergesort the right half

Mergesort the two sorted halves into one sorted list

Endif.

 

 

Posted Date: 7/10/2012 3:32:11 AM | Location : United States







Related Discussions:- Merge sort, Assignment Help, Ask Question on Merge sort, Get Answer, Expert's Help, Merge sort Discussions

Write discussion on Merge sort
Your posts are moderated
Related Questions
Post-order Traversal This can be done both iteratively and recursively. The iterative solution would need a change of the in-order traversal algorithm.

algorithm for multiplication of two sparse matrices using link list

Q. Execute your algorithm to convert the infix expression to the post fix expression with the given infix expression as input Q = [(A + B)/(C + D) ↑ (E / F)]+ (G + H)/ I

Linear search employee an exhaustive method of verified each element in the array against a key value. Whereas a match is found, the search halts. Will sorting the array before uti

Type of Qualitative Method: Different  qualitative methods are suitable for different  types of study. Quite often we can  combine  qualitative and quantitative  methods. Many

Q. Using the following given inorder and preorder traversal reconstruct a binary tree Inorder sequence is D, G, B, H, E, A, F, I, C

What do you understand by structured programming Structured Programming  This term is used for programming design that emphasizes:- (1) Hierarchical design of programmi

that will determine the volume of the sphere or the volume of cone or volume of pyramid depending on the choice of the user

A graph with n vertices will absolutely have a parallel edge or self loop if the total number of edges is greater than n-1

A significant aspect of Abstract Data Types is that they explain the properties of a data structure without specifying the details of its implementation. The properties might be im