GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - JoeKarlsson/data-structures: Common data structures and algorithms implemented in JavaScript

This repository was archived by the owner on Nov 9, 2026. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

148 Commits
148 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.husky
.husky
 
 
binary-heap
binary-heap
 
 
bitwise
bitwise
 
 
complex-array
complex-array
 
 
fast-fourier-transforms
fast-fourier-transforms
 
 
graph-traversing
graph-traversing
 
 
graph
graph
 
 
hash-table
hash-table
 
 
linked-list
linked-list
 
 
list
list
 
 
memoization
memoization
 
 
queue
queue
 
 
rabin-karp
rabin-karp
 
 
search
search
 
 
shortest-path
shortest-path
 
 
sorting
sorting
 
 
stack
stack
 
 
test
test
 
 
trie
trie
 
 
.gitignore
.gitignore
 
 
.prettierignore
.prettierignore
 
 
.prettierrc
.prettierrc
 
 
.travis.yml
.travis.yml
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
eslint.config.js
eslint.config.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

JavaScript Data Structures and Algorithms

Coverage Status Build Status Maintainability stars pr license twitter Greenkeeper badge

I put this repository together to get ready for technical interviews. I hope it helps you get ready for your next big technical interview. If you like what you see plz give it a star. Also, feel free to contribute :D

What is an algorithm?

In simple terms, it is possible to say that an algorithm is a sequence of steps which allow to solve a certain task ( Yes, not just computers use algorithms, humans also use them). Now, an algorithm should have three important characteristics to be considered valid:

  1. It should be finite: If your algorithm never ends trying to solve the problem it was designed to solve then it is useless

  2. It should have well defined instructions: Each step of the algorithm has to be precisely defined; the instructions should be unambiguously specified for each case.

  3. It should be effective: The algorithm should solve the problem it was designed to solve. And it should be possible to demonstrate that the algorithm converges with just a paper and pencil.

Getting Started

  1. Run npm install
  2. Run npm test to run all of the algorithms

This repo covers the following topics:

  • Binary Heap
  • Bitwise
  • Complex Arrays
  • Graph Traversing
    • Breadth First Search
    • Depth First Search
  • Graph
    • Graph Node
    • Grid Graph
    • Tree Node
  • Hash Table
  • Fast Fourier Transformations
  • Linked Lists
  • List
  • Memoization
  • Queue
    • Priority Queue
    • Queue
  • Rabin Karp
  • Search
    • Binary Search Trees
    • Linear
  • Shortest Path
    • A*
    • Dijkstra
  • Sorting
    • Bubble Sort
    • Insertion Sort
    • Merge Sort
    • Quick Sort (duh)
    • Selection Sort
  • Stack
  • Trie

An algorithm is a self-contained step-by-step set of operations to be performed. Algorithms perform calculation, data processing, and/or automated reasoning tasks.

"Elegant" (compact) programs, "good" (fast) programs : The notion of "simplicity and elegance" appears informally in Knuth and precisely in Chaitin:

Knuth: ". . .we want good algorithms in some loosely defined aesthetic sense. One criterion . . . is the length of time taken to perform the algorithm . . .. Other criteria are adaptability of the algorithm to computers, its simplicity and elegance, etc"

Chaitin: " . . . a program is 'elegant,' by which I mean that it's the smallest possible program for producing the output that it does"

TODO

  • Timsort
  • Floyd-Warshall
  • Traveling Salesman
  • k-way merge
  • Matching users to servers, using Gayle-Shapely Algorithm for Stable Marriage problem
    • This is a beautiful algorithm for fair matching. Simple, elegant and effective. In its core form, it’s also straightforward to implement. Has numerous applications. See: Stable marriage problem - Wikipedia
  • A toy implementation of Viterbi algorithm
    • Ubiquitous in cell phone technology, and many other applications, Viterbi algorithm is a Dynamic Programming based algorithm that finds the most likely sequence of states.
    • SSL transport, is the bane of safe existence on Internet these days. One of the most well-known algorithms in secure transport, is RSA, named by the first initials of its inventors. Implementing RSA is fun and instructive e.g. C code to implement RSA Algorithm(Encryption and Decryption)
  • Safe Browsing (or similar) using Bloom filters
    • Bloom filters found very rare usage until the world got more online and we hit scale. But these days, we see new applications very frequently.Chrome browser uses Bloom filters to make preliminary decision on safe browsing. See some novel applications here.
  • Implement an LALR parser
    • As a CS student, you may have already implemented it as part of your compiler’s class. But if not, then you should. LALR parsing makes syntactic sense of source code, whichever language you use. Many implementations of LALR exist. e.g. Where can I find a simple, easy to understand implementation of an LR(1) parser generator? Also, use YACC to understand LALR parsing better.
  • Treemap using Red Black Trees!
    • RB Trees are not algorithms, but they are famed enough, that no discussion of tantalizing DS/Algorithms is complete without discussing them. The smoothest way to see/implement RB Trees, is to look at Treemap implementation in Java.
  • Circle Drawing using Bresenham’s algorithm
    • Ever wondered, how circles are drawn on the screen, with minimal jaggedness (aliasing)? Bresenham’s elegant algorithm is at play here. See a version here: Circle Generation Algorithm . A refreshing use of a similar algorithm, is to make properly sized tabs in Chrome. Something we see almost every day. Such hidden gems!
  • Implement PageRank
    • Can’t miss this. This transformed our lives in ways we never thought possible. Get started here: Pagerank Explained Correctly with Examples

Contributing

Don't hesitate to create a pull request. Every contribution is appreciated. In development you can start the tests by calling npm test. Checkout our contribution README for more info.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Maintainers


Joe Karlsson

LICENSE

MIT

About

Common data structures and algorithms implemented in JavaScript

Topics

a-staralgorithmalgorithmsarraybinary-heapbitwisebreadth-first-searchdata-structuresdijkstragraphgraph-algorithmshash-tablelinked-listmemoizationqueueshortest-pathssorting-algorithms-implementedstacktree

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity

Stars

184 stars

Watchers

2 watching

Forks

42 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.