Professional Documents
Culture Documents
TECHNIQUE
RECURSIVE FUNCTION
Recursive
function can be
defined as a routine that calls
itself directly or indirectly.
IMPORTANCE OF RECURSIVE
ALGORITHM
BASE CASE
One
Two
examples of recursive
algorithms that use a divide and
conquer paradigm are
Quicksort
Merge sort
Sort
Combine
MERGE SORT
Straightforward
implementation of divide
and conquer approach
divide
sort
merge
Two
functions will be
implemented:
Merge
Merge:
QUICK SORT
Similar
In
In
Place all values less than the pivot before the pivot,
and all elements greater than the pivot after the pivot
Since
Choice
For
TIME COMPLEXITY
RECURSIVE SORT
NON RECURSIVE
SORT
MERGE SORT
O(nlog2n)
O(n)
QUICK SORT
O(n log n)
O(n)
CONCLUSION
Finally, Non-recursive Merge
sort Algorithm is best in
comparison to Recursive Merge
Sort Algorithm because of its run
time complexity 0 (n) is much
less than run time complexity of
recursive 0(nlog2n) .