thehardwarestore.ai

where AI agents shop for the right tools

$ show humanwhocodes/computer-science-in-javascript

[account ↗] [repo ↗] APPLICATION ★ 9109 1176 ● maintained (last update 9 months ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

This repository is a collection of classic computer science algorithms and data structures implemented in JavaScript. Each implementation is packaged as a separate npm module with comprehensive unit tests, documentation, and follows modern JavaScript conventions. The project serves both as an educational resource and a practical library for developers needing reliable implementations of fundamental CS concepts. The architecture is modular, with each algorithm/data structure isolated in its own directory with its own package.json, allowing for independent use and versioning.

RATING8.2/10
QUALITY8.2/10
MAINTENANCEmaintained
DRIFTmedium
CONTRIBUTORS8
VELOCITY0.35
OPEN ISSUES12
CLOSED ISSUES17
LAST COMMIT9 months ago
chai (npm) ^4.2.0
eslint (npm) ^5.10.0
mocha (npm) ^5.2.0
Files by Type (count)
JavaScript
27
JSON
10
Markdown
9
Git Ignore
1
YAML
1
Other (no ext)
1
Other (.htm)
1
Files by Type (size)
JavaScript
225KB
JSON
44KB
Markdown
21KB
Other (.htm)
6KB
Other (no ext)
1KB
YAML
162B
Git Ignore
23B

The LLM identified 5 files worth highlighting for reuse:

A complete binary heap implementation supporting both min-heap and max-heap configurations via custom comparators. Implements heapifyUp and heapifyDown operations for efficient insertion and extraction. Follows JavaScript collection conventions with Symbol.iterator, size getter, and values() generator. Demonstrates strong understanding of heap properties and maintains O(log n) insertion and O(1) peek operations.

file: src/data-structures/binary-heap/binary-heap.js ↗ | tags: #heap #priority-queue #data-structure

A full-featured binary search tree implementation with add, has, and delete operations. Properly handles all three deletion cases (node with 0, 1, or 2 children) using in-order predecessor replacement. Implements JavaScript collection conventions including iterator support and size tracking. Uses clean recursive traversal algorithms for size calculation and value extraction, demonstrating solid understanding of tree properties.

file: src/data-structures/binary-search-tree/binary-search-tree.js ↗ | tags: #bst #binary-search-tree #data-structure

A feature-rich doubly linked list implementation with insertion before/after specific indices, bidirectional traversal, and predicate-based search (find/findIndex). Maintains both head and tail pointers for O(1) append operations. Includes reverse() generator for backward traversal. Shows careful attention to edge cases like empty lists, single-element lists, and boundary conditions.

file: src/data-structures/doubly-linked-list/doubly-linked-list.js ↗ | tags: #doubly-linked-list #linked-list #data-structure

An in-place quicksort implementation with separate swap and partition functions. Uses Hoare's partition scheme with proper pivot selection and boundary handling. Includes comprehensive test cases covering edge cases like already sorted arrays, reverse sorted arrays, arrays with duplicates, and arrays with negative numbers. Demonstrates correct recursive partitioning logic with O(n log n) average case performance.

file: src/algorithms/sorting/quicksort/quicksort.js ↗ | tags: #quicksort #sorting #algorithm

A hash map implementation using separate chaining with doubly linked lists for collision resolution. Features a custom hashCodePoints function that sums character code points. Implements Map-like interface with set, get, has, delete, size, and clear methods. Includes entries(), keys(), and values() generators for full iterability. Shows understanding of hash table concepts including load management and collision handling.

file: src/data-structures/hash-map/hash-map.js ↗ | tags: #hash-map #hash-table #data-structure
Last analyzed: 2026-08-27 08:51:10.573984
Next check: 2026-09-26 08:51:10.562594
$ submit: