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
- Host: GitHub
- URL: https://github.com/carlosfrontend/project-recursion
- Owner: carlosfrontend
- License: mit
- Created: 2024-03-19T11:28:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-26T10:26:29.000Z (about 1 year ago)
- Last Synced: 2024-12-30T09:42:36.595Z (4 months ago)
- Language: JavaScript
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.