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
Given a number that is represented in your data structure, you will need a function that prints it out in base 215 in such a way that its contents can be checked for correctness. Y

C compiler does not verify the bounds of arrays. It is your job to do the essential work for checking boundaries wherever required. One of the most common arrays is a string tha

What do you understand by tree traversal? The algorithm walks by the tree data structure and performs some computation at everynode in the tree. This process of walking by the

Q. Write  down the  algorithm  to  insert  an  element  to  a  max-heap  which  is  represented sequentially.           Ans: The algorithm to insert an element "newkey" to

I am looking for some help with a data mining class with questions that are about neural networks and decision trees. Can you help? I can send document with questions.

important points on asymptotic notation to remember

There are ten stations on a railway line: Train travels in both directions (i.e. from 1 to 10 and then from 10 to 1).  Fare between each station is $2. A passenger input

HSV Colour Model Instead of a set of colour primaries, the HSV model uses colour descriptions that have a more intuitive appeal to a user. To give a colour specification, a use

Q. Describe the basic concept of binary search technique? Is it more efficient than the sequential search?         Ans : The bin ary search technique:- This tec

Q. Let a binary tree 'T' be in memory. Write a procedure to delete all terminal nodes of the tree.       A n s . fun ction to Delete Terminal Nodes from Binary Tree