Skip to content

Roxanoel/recursion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Recursion

Recursion exercises for The Odin Project.

Exercise 1:

Using iteration, write a function fibs which takes a number and returns an array containing that many numbers from the fibonacci sequence. Using an example input of 8, this method should return the array [0, 1, 1, 2, 3, 5, 8, 13]. Now write another method fibsRec which solves the same problem recursively. This can be done in just a couple of lines (or 1 if you’re crazy, but don’t consider either of these lengths a requirement… just get it done).

Exercise 2:

Build a function mergeSort that takes in an array and returns a sorted array, using a recursive merge sort methodology.

Testing

I have included my jest test files. To use, simply install Jest in npm, and run your preferred test command. All tests were passed in this last commit.

About

Recursion exercises for The Odin Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published