*Don't forget to use Git to save your projects!*

The Fibonacci Sequence, which sums each number with the one before it, is a great example of a problem that can be solved recursively.

- Write a method
`#fibs`

which takes a number and returns that many members of the fibonacci sequence. Use iteration for this solution. - Now write another method
`#fibs_rec`

which solves the same problem recursively. This can be done in just 3 lines (or 1 if you're crazy, but don't consider either of these lengths a requirement... just get it done).

*Send us your solution so we can show others! Submit a link to the Github repo with your files in it here using any of the methods listed on the contributing page. Please include your partner's github handle somewhere in the description if they would like attribution.*

- Add your solution below this line!
- Orlando's solution
- ToTenMilan's solution
- Nicolas Amaya's solution
- Raiko's solution
- nmac's solution
- John Phelps's solution
- Charles's solution
- Jib's Solution
- Braydon Pacheco's solution
- Stefan P's solution
- mahimahi42's solution
- Chris's solution
- Jamie's solution
- Donald's solution
- Mazin's solution
- TomTom's solution
- Marina Sergeyeva's solution
- Tommy Noe's solution
- Michael Alexander's solution
- Sahil Agarwal's solution
- James MacIvor's solution
- Dave Charnuska's solution
- Hawkeye's solution
- Aleksandar's solution
- Vidul's solution
- John Quarles' solution
- Artur Janik's solution
- Kate McFaul's solution
- Dominik Stodolny's solution
- Jason Matthews' solution
- Lara Finnegan's solution
- Nikola Čvorović's solution
- Kevin Mulhern's solution
- Jeremy Mauzy's solution
- Chris Dziewa's solution
- Eduardo Frias' solution
- Frank Peelen's solution
- Chris's solution
- AtActionPark's solution
- Matias Pan's solution
- Alex Chen's solution
- Joe Balsamo's solution
- Dan Hoying's solution
- hiendinhngoc's solution
- Mark Viola's solution
- PiotrAleksander's solution
- Solution by John Tobillo
- Noah Prescott's solution
- Julie Anderson's solution
- Florian Mainguy's solution
- Andrej Dragojevic's solution
- Sander Schepens's solution
- Aviv levinsky's solution
- Fyodor's solution
- Giorgos's solution
- Alex Tsiras' solution
- Andrew Park's solution
- srashidi's solution
- Dave Meister's solution (One-Liners)
- Panashe Fundira's solution
- James Brooks's solution
- cdouglass's solution
- Skye Free's solution
- Matt Velez's solution
- Luke Walker's solution
- Ricardo Villegas' solution
- djhart's solution
- Miguel Herrera's solution
- Max Gallant's solution
- Fabricio Carrara's solution
- John's solution (returns full sequence)
- DV's solution
- Deepak's solution
- Earth35's solution
- Shala Qweghen's solution
- Austin Mason's solution
- John Connor's solution
- Oscar Y.'s solution
- Amrr Bakry's solution
- Manu Phatak's solution
- Jean Merlet's solution
- Sasho's solution
- Jiazhi Guo's solution
- Francisco Carlos's solution
- Chris Chambers' solution
- Loris Aranda's solution
- at0micr3d's solution
- Peuchen's solution
- Clint's solution
- Anthony Vumbaca's solution
- David Chapman's solution
- Leonard Soai-Van's solution
- Jerry Gao's solution
- Sophia Wu's solution
- Samuel Langenfeld's solution
- Kyle Thomson's solution
- Jakub Peikert's solution
- Robert Szabo's solution

We spent some time early on dealing with sorting (e.g. bubble sort). Now it's time to take another look at sorting with Merge Sort, a type of sort that lends itself well to recursion and can be much faster than bubble sort on the right data sets. You'll build a method which sorts a given array but uses a "merge sort" method for doing so.

It can be a bit strange to wrap your head around, but just remember you're "dividing and conquering" the problem.

The first step is to actually understand what the merge sort algorithm is doing:

- Check out this video from Harvard's CS50x course.
- Merge Sort -- How it Works part 1 and Merge Sort -- How it Works part II on YouTube give you a more formal look at this problem if you're still unclear.

- Build a method
`#merge_sort`

that takes in an array and returns a sorted array, using a recursive merge sort methodology. Tips:

- 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 method!).
- It may be helpful to check out the background videos again if you don't quite understand what should be going on.

*Send us your solution so we can show others! Submit a link to the Github repo with your files in it here using any of the methods listed on the contributing page. Please include your partner's github handle somewhere in the description if they would like attribution.*

- Add your solution below this line!
- yilmazgunalp's solution
- Orlando's solution
- ToTenMilan's solution
- Ayushka's solution
- Nicolas Amaya's solution
- Raiko's solution
- nmac's solution
- John Phelps's solution
- Braydon Pacheco's solution
- Stefan P's solution
- mahimahi42's solution
- Chris's solution
- Jamie's solution
- Donald's solution
- Mazin's solution
- TomTom's solution
- Marina Sergeyeva's solution
- Tommy Noe's solution
- Michael Alexander's solution
- Adrian Badarau's solution
- Erithair's solution
- Sahil Agarwal's solution
- James MacIvor's solution
- Aleksandar's solution
- Vidul's solution
- John Quarles' solution
- Artur Janik's solution
- Kate McFaul's solution
- Dominik Stodolny's solution
- Jason Matthews' solution
- Nikola Čvorović's solution
- Lara Finnegan's solution
- Kevin Mulhern's solution
- Jeremy Mauzy's solution
- Eduardo Frias' solution
- Frank Peelen's solution
- Chris's solution
- AtActionPark's solution
- Matias Pan's solution
- Alex Chen's solution
- Joe Balsamo's solution
- Dan Hoying's solution
- hiendinhngoc's solution
- Mark Viola's solution
- PiotrAleksander's solution
- Solution by John Tobillo
- Noah Prescott's solution
- Julie Anderson's solution
- Florian Mainguy's solution
- Andrej Dragojevic's solution
- Sander Schepens's solution
- Aviv levinsky's solution
- Scott Bobbitt's solution
- Giorgos's solution
- Alex Tsiras' solution
- Andrew Park's solution
- srashidi's solution
- Dave Meister's solution
- Panashe Fundira's solution
- James Brooks's solution
- cdouglass's solution
- Skye Free's solution
- Matt Velez's solution
- Luke Walker's solution
- Ricardo Villegas' solution
- djhart's solution
- Miguel Herrera's solution
- Max Gallant's solution
- Fabricio Carrara's solution
- John's solution (help from Sahil's code)
- DV's solution)
- Deepak's solution
- Earth35's solution
- Cyprium (Stefan)'s solution
- Shala Qweghen's solution
- Austin Mason's solution
- John Connor's solution
- Oscar Y.'s solution
- Amrr Bakry's solution
- Manu Phatak's solution
- Jean Merlet's solution
- Sasho's solution
- Jiazhi Guo's solution
- Francisco Carlos's solution
- Chris Chambers' soution
- Loris Aranda's solution
- at0micr3d's solution
- Peuchen's solution (help from Florian's code)
- Clint's solution
- Anthony Vumbaca's solution
- David Chapman's Solution
- Leonard Soai-Van's solution
- Dom Goj's solution
- Jerry Gao's solution
- Marcus' solution
- Sophia Wu's solution
- Samuel Langenfeld's solution
- Kyle Thomson's solution
- Jakub Peikert's solution
- Robert Szabo's solution

*This section contains helpful links to other content. It isn't required, so consider it supplemental for if you need to dive deeper into something*

- Another look at merge sort
- For more attempts at recursion try the first 5 problems in Project Euler

From the creators of The Odin Project...

The Viking Code School