Describe the sorting pattern. Discuss the Merge sort routines in terms of this pattern.
What will be an ideal response?
Sort array
1)Get split point and Split two parts
2)Sort first part(recursive)
3)Sort second part (recursive)
4)Join sorted parts.
Explanation:
Merge sort:
1)Split is trivial: calculate the
middle - (begin – end);/2
The parts differ in size by at most 1.
2)Recursively sort first part.
3)Recursively sort second part.
4)Merge sorted parts
Postcondition on the Merging: The result is sorted.
(The hard work is done here)
The division into two pieces of nearly equal causes the routine to run in O(N log N) time.
You might also like to view...
Apache version 2.2 is included with openSUSE and is installed by default.
Answer the following statement true (T) or false (F)
From within Word, you can search through various forms of reference information.
Answer the following statement true (T) or false (F)
A split form allows you to view data from two different sources on the same screen at one time
Indicate whether the statement is true or false
What is a logo and what does it do for a brand or entity?
What will be an ideal response?