Professional Documents
Culture Documents
Report
Report
Report
Sort
Understanding the Algorithm and its Applications
Introduction
• Brief explanation of the concept of sorting algorithms
• Introduction to the Divide and Conquer paradigm
What is Merge Sort?
• Merge Sort is a popular sorting algorithm that follows the Divide and Conquer
paradigm
• The main idea behind Merge Sort is to divide the unsorted list into n sublists, each
containing one element, and then repeatedly merge sublists to produce new
sorted sublists until there is only one sublist remaining, which is the sorted list.
Divide and Conquer paradigm
• Divide: The unsorted list is divided into two equal halves repeatedly until each
sublist contains only one element.
• Conquer: The divided sublists are sorted recursively.
• Merge: The sorted sublists are merged back together in a sorted manner. During
the merge process, elements from the two sublists are compared and merged into
a new sorted sublist.
• Repeat: Steps 1-3 are repeated until the entire list is sorted.
Visual Representation
• Visual diagram or animation demonstrating how Merge Sort works.
Advantages of Merge Sort Where Merge Sort is commonly used
if n <= 1:
return n
else:
1.Original Call:
•fibonacci(5)
•Calls fibonacci(4) and fibonacci(3).