An open API service indexing awesome lists of open source software.

https://github.com/carlosfrontend/project-recursion

Recursion : See Assigment1 and Assigment2
https://github.com/carlosfrontend/project-recursion

Last synced: 3 months ago
JSON representation

Recursion : See Assigment1 and Assigment2

Awesome Lists containing this project

README

        

# Recursion Project (Odin Project)

## Assignment 1

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 function should return the array [0, 1, 1, 2, 3, 5, 8, 13].

2. Now write another function fibsRec which solves the same problem recursively.

## Assignment 2

1. Build a function mergeSort that takes in an array and returns a sorted array,
using a recursive merge sort methodology. An input of [3, 2, 1, 13, 8, 5, 0, 1]
should return [0, 1, 1, 2, 3, 5, 8, 13], and an input of [105, 79, 100, 110]
should return [79, 100, 105, 110].

2. Tips:

1. Think about what the base case is and what behavior is happening again and
again and can actually be delegated to someone else (e.g. that same function!).

2. It may be helpful to check out the background videos again if you don’t
quite understand what should be going on.

### *To see this working you can clone this repository with:

```$ git clone https://github.com/carlosfrontend/project-recursion.git```

### And then:

``` $ cd project-recursion ```

``project-recursion$`` ``` npm install ```

### Open the folder with your code editor

... and do ```npm start``` in the terminal

### Feel free to change the values ​​of the variables in the ```main.js``` file to see the results by the console.