Data structures and algorithms practice, organised by topic. The solutions here are written in JavaScript and Go.
Some solutions keep a brute force version first and an optimised version after it, with the LeetCode link in a comment at the top.
- Basics: small programs on numbers, math, arrays, strings, objects, sets and maps and linked lists
- Language notes: array basics
- Arrays: including matrix and subarray problems
- Strings
- Linked list: singly and doubly linked lists, reverse, merge, middle node, remove nth from end
- Stack and queue: stack basics
- Techniques: hashing, two pointer, sliding window, priority queue, prefix sum
- Binary search
- Sorting: selection sort, bubble sort
- Recursion and backtracking: starter and basics
This repo is a collection of standalone practice files, not one application, so there is no single setup. Many of the JavaScript files run with Node.js:
node _8_sorting/_1_selection_sort/sort_array.jsNot every file in this repo runs as it is. Some need packages that are not declared in this repo (such as lodash), some use browser features (prompt, document), and some need inputs or are unfinished. The Go files here are snippets without a package line, so they are not runnable on their own.