Explain about Merge Sort?



Explain about Merge Sort?..

Answer / rohit sah

Merge-sort is based on the divide-and-conquer paradigm. The Merge-sort algorithm can be described in general terms as consisting of the following three steps:
1. Divide Step
If given array A has zero or one element, return S; it is already sorted. Otherwise, divide A into two arrays, A1 and A2, each containing about half of the elements of A.
2. Recursion Step
Recursively sort array A1 and A2.
3. Conquer Step
Combine the elements back in A by merging the sorted arrays A1 and A2 into a sorted sequence.
We can visualize Merge-sort by means of binary tree where each node of the tree represents a recursive call and each external nodes represent individual elements of given array A. Such a tree is called Merge-sort tree. The heart of the Merge-sort algorithm is conquer step, which merge two sorted sequences into a single sorted sequence.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

How do you declare An array of three char pointers

0 Answers  


Describe the complexity of Binary search

0 Answers   Honeywell, Zomato,


What is difference between data type and data structure?

0 Answers  


Which is faster hashmap or hashtable?

0 Answers  


What are stacks? Give some of its applications.

0 Answers   TCS,






How do you use merge sort?

0 Answers  


Can a stack be described as a pointer? Explain.

0 Answers  


What are threaded binary trees?

0 Answers  


What is difference between list and set?

0 Answers  


What is data structure geeksforgeeks?

0 Answers  


How many types of linked lists are there?

0 Answers  


Write code for reversing a linked list.

0 Answers  


Categories