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 |
Now you are given an array of a characters (both ASCII and Kanji) and, an index into the array. The index points to the start of some character. Now you need to write a function to do a backspace (i.e. delete the character before the given index).
Which is faster arraylist or linked list?
How do we search a specific element in an array?
Define root?
What is an example of an algorithm?
What is reduction to sorting method?
What is a matrix?
In what areas do data structures are applied?
What are the drawbacks of array implementation of queue?
How do you do binary search?
What is a b+ tree? Explain its uses.
Describe the complexity of Quick Sort