JustinY07/MergeSortMakerCISC121
I chose Merge Sort because it demonstrates the fundamental computer science principle of Divide and Conquer. This project will focus on visualizing the Abstraction inherent in recursion, allowing the user to see the sorted sub-lists merge back together, which helps in learning how efficient sorting scales.
Decomposition: The list is recursively split into two halves until each sub-list contains only one element (a sorted list). Then, these single-element lists are repeatedly combined (merged) back into larger sorted lists until the full list is sorted.
Pattern Recognition: The core pattern is the merging step. The process of taking two already-sorted sub-lists and comparing their first elements, then iteratively moving the smaller element to a new output list, is repeated at every level of the recursive calls.
Abstraction: The user will input one unsorted list. The underlying code handles all the complex recursive function calls and the temporary list creations without the user needing to worry about the memory management or the call stack. The app focuses only on showing the Divide and Merge results.
Algorithm Design:
- Input: A list of numbers (e.g., [8, 3, 1, 5]) is entered by the user.
- Processing (Divide): The mergesort function recursively splits the list until all sub-lists are size 1.
- Processing (Conquer/Merge): The merge function compares and combines these sub-lists in sorted order.
- Output: The fully sorted list (e.g., [1, 3, 5, 8]) and, crucially, a demonstration of the steps (e.g., a visualization or a text log of the splits and merges).
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
