Skip to content

jason-nordheim/algo-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About this Repository

This is a pretty bare-bones repository containing common algorithms implemented using TypeScript and bun for compilation and testing.

The folder structure is as follows:

.gitignore
bun.lockb                 <-- bun lock file
package.json
src/
  /dynamicProgramming/    <-- directory containing dynamic programming problems/solutions/tests
    [problemName].ts
    [problemName].test.ts
  /leetCode/              <-- directory containing leetcode problems/solutions/tests
    [problemName].ts
    [problemName].test.ts
  /pathfinding/
    [algorithmName].ts
    [algorithmName].test.ts
  [algorithmName]/
    [algorithmName].ts      <-- sorting function
    [algorithmName].test.ts <-- test for the algorithm

The Algorithm Files

Every algorithm is accompanied with js doc comments that explain:

  • What the algorithm is doing
  • It's time complexity (in Big O notation)

Table of Contents

  • Searching
    • Binary Search
  • Pathfinding (located in src/pathfinding/<algorithmName>/)
    • Dijkstra
  • Sorting (located in src/sortingAlgorithms/<algorithmName>/)
    • Bubble Sort
    • Selection Sort
    • Insertion Sort
    • Merge Sort
    • Quick Sort
    • Radix Sort (LSD)
  • leetCode (directory containing leetcode problems/solutions with tests)

Running the tests

Important: This project is setup to use bun which is currently only supported on macOS, Linux and WSL. So in order to run this project on a windows machine, you must be in WSL.

  1. Installing Bun: Run curl -fsSL https://bun.sh/install | bash from the command line.
  2. Run bun install to add the packages to node_modules
  3. Run bun test to run the tests

Since there is no UI, the only available command is npm run test.

If you would like a code coverage report, run: bun coverage

About

Custom Algorithms written in TypeScript

Topics

Resources

Stars

Watchers

Forks