Skip to content

This repository showcases two code assignments that emphasize the use of recursion and the implementation of the merge sort algorithm.

Notifications You must be signed in to change notification settings

LaythAlqadhi/recursion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Recursion and Merge Sort

This repository showcases two code assignments that emphasize the use of recursion and the implementation of the merge sort algorithm.

Assignment 1: Recursive Functions

This section includes two functions illustrating the power of recursion:

  1. fibs(n): Calculates the nth Fibonacci number using a loop and an array to store intermediate values.

  2. fibsRec(a, b = 1, fib = [0, 1]): Implements Fibonacci number generation recursively.

Assignment 2: Merge Sort Algorithm

The second assignment presents functions for implementing the merge sort algorithm:

  1. mergeSort(array): Sorts an array using the merge sort algorithm, which is an efficient sorting technique based on divide and conquer.

  2. merge(left, right): A helper function that merges two sorted arrays into a single sorted array, a fundamental step in the merge sort process.

About

This repository showcases two code assignments that emphasize the use of recursion and the implementation of the merge sort algorithm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published