Skip to content

SP2224/MERGE-SORT

Repository files navigation

MERGE-SORT

Merge sort is a sorting technique based on divide and conquer technique. With worst-case time complexity being Ο(n log n), it is one of the most respected algorithms.

Merge sort first divides the array into equal halves and then combines them in a sorted manner.

APPROACH

Step 1 − if it is only one element in the list it is already sorted, return.

Step 2 − divide the list recursively into two halves until it can no more be divided.

Step 3 − merge the smaller lists into new list in sorted order.

Merge Sort Complexity

Time Complexity

Best Case Complexity: O(n*log n)

Worst Case Complexity: O(n*log n)

Average Case Complexity: O(n*log n)

Space Complexity

The space complexity of merge sort is O(n).

REFERENCE

1.My code school(merge sort):-

https://www.youtube.com/watch?v=TzeBrDU-JaY&t=328s

2.My code school(analyisis of merge sort):-

https://www.youtube.com/watch?v=0nlPxaC2lTw

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages