This project is focused on creating recursive functions to demonstrate an understanding of recursion. The functions include implementations of the Fibonacci sequence and Merge Sort algorithms.
For more details on this project, please visit The Odin Project - Project: Recursion.
Create two functions that take an integer and return the Fibonacci sequence as an array. The first function, named fibs
, implements the sequence using a loop. The second function, named fibsRec
, uses recursion.
Example: fibs(8)
should return [0, 1, 1, 2, 3, 5, 8, 13]
.
Create a recursive function named mergeSort
that takes an array of numbers and returns a sorted array using the merge sort method.
Example: mergeSort([3, 2, 1, 13, 8, 5, 0, 1])
should return [0, 1, 1, 2, 3, 5, 8, 13]
.