Skip to content

julimen5/interview-algorithms

Repository files navigation

License: MIT Build Status codecov

interview-algorithms

Another list of interest algorithms to prepare for an interview in js

Algorithms

Sorting

  • Bubble sort
  • Selection sort
  • Insertion sort
  • Merge sort
  • Quicksort

Usage

const { sort } = require('./index');
const bubbleSorted = sort.bubbleSort([5,4,3,2,1]);
const selectionSorted = sort.selectionSort([5,4,3,2,1]);
const insertionSorted = sort.insertionSort([5,4,3,2,1]);
const mergeSorted = sort.mergeSort([5,4,3,2,1]);
const quickSorted = sort.quickSort([5,4,3,2,1], 0, 4);

Searching

  • Linear search
  • Jump search <<<<<<< HEAD
  • Binary search

Usage

const { search } = require('./index');
const linearSearched = search.linearSearch([5,4,3,2,1], 4);
const jumpSearched = search.jumpSearch([1,2,3,4,5], 2, 1);
const jumpSearched = search.binarySearch([1,2,3,4,5], 2);

Graphs

  • BFS

Usage

const { graph } = require('./index');
const bfs = graph.bfs(3, 7, [[1, 2], [2, 3], [3, 4], [4, 5], [7, 8]]);

About

Another list of interest algorithms to prepare for an interview

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published