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
Explain Internal and External Nodes  To  draw  the  tree's  extension  by  changing  the  empty  subtrees  by  special nodes. The  extra  nodes shown by little squares are know

Implementation of Stack :- Stacks can be executed in the 2 ways: a)  Arrays b)  Linked List

Explain in detail the algorithmic implementation of multiple stacks.

A Binary Search Tree is binary tree which is either empty or a node having a key value, left child & right child. By analyzing the above definition, we notice that BST comes int

One of the main problems with the linear queue is the lack of appropriate utilization of space. Assume that the queue can store 100 elements & the complete queue is full. Thus, it

How To implement stack using two queues , analyze the running time of the stack operations ?

prove that n/100=omega(n)

algorithm and flow chart to find weather the given numbers are positive or negative or neutral

What do you understand by term structured programming? Explain the structured programming as well.                                 Ans. S tructured Programming is expla

characteristics of a good algorithm