This repository showcases two code assignments that emphasize the use of recursion and the implementation of the merge sort algorithm.
This section includes two functions illustrating the power of recursion:
-
fibs(n)
: Calculates the nth Fibonacci number using a loop and an array to store intermediate values. -
fibsRec(a, b = 1, fib = [0, 1])
: Implements Fibonacci number generation recursively.
The second assignment presents functions for implementing the merge sort algorithm:
-
mergeSort(array)
: Sorts an array using the merge sort algorithm, which is an efficient sorting technique based on divide and conquer. -
merge(left, right)
: A helper function that merges two sorted arrays into a single sorted array, a fundamental step in the merge sort process.