Inspiration

The inspiration behind this project is to explore the various time and space complexities attached with sorting a list. Here, I used a divide and conquer algorithm.

What it does

The really interesting this is: despite the fact that it uses recursion, MergeSort, a divide and conquer algorithm is much faster than n^2! It recursively divides a list into smaller elements, and then compare the divided segments until we have a mergerd and sorted list!

How we built it

Built using two different functions in java: one to recursively break the list until we are dealing with two single parts of a list, with one element each, which is the base case. After which we start merging after sorting the elements in the subarrays.

Challenges we ran into

Understanding the recursive process of merge sort was hard, especially because the slicing of lists into two is not always with the same size.

Accomplishments that we're proud of

It sorted an unsorted list!

What we learned

What's next for Recursive Sorting using MergeSort

Share this project:

Updates