-
Notifications
You must be signed in to change notification settings - Fork 311
Data Structures (old)
Sahil edited this page Jun 4, 2020
·
1 revision
- Array (Both sorted and unsorted)
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Insertion in array | |||||
| Deletion in array | delete-array-cpp | ||||
| Array doubling and amortized complexity | array-doubling-cpp | ||||
| Dynamic Arrays | dynamic-arrays-cpp | ||||
| Vector (C++ STL) | vector-cpp | ||||
| Array Rotation | array-rotation-cpp |
- Linked Lists (Both sorted and unsorted)
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Insertion, Deletion, Search, Traversal, Reversal | list-implementation-cpp | ||||
| Reverse Linked List | reverse-ll-cpp | ||||
| Add numbers using Linked Lists | add-ll-cpp | ||||
| Multiply numbers using Linked Lists | multiply-ll-cpp | ||||
| Merge Sort using Linked Lists | merge-sort-ll-cpp | ||||
| List using STL (C++) | list-stl-cpp | ||||
| Forward List in STL (C++) | forward-list-cpp | ||||
| Floyd Cycle Detection | ll-cycle-detect-java | ||||
| Partition Linked Lists around a value | ll-partition-java | ||||
| Check whether linked list is a palindrome | ll-palindrome-java | ||||
| Check for intersection of two linked lists | intersection-ll-java | ||||
| Delete middle node from Linked List | delete-middle-java |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Stack using arrays | stack-array-cpp | ||||
| Stack using linked lists | stack-ll-cpp | ||||
| STL stack (C++) | stl-stack | ||||
| Infix to Postfix converstion | infix-to-postfix-cpp | ||||
| Implement Stack using queues | |||||
| Stack that supports getMin in O(1) time and O(1) space |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Queue using arrays | queue-array-cpp | ||||
| Queue using linked lists | queue-ll-cpp | ||||
| STL queue (C++) | stl-queue | ||||
| Implement queue using stacks | |||||
| Circular queue implementation | |||||
| Doubly ended queue implementation | |||||
| Max Priority Queue | max-pq-cpp | ||||
| Min Priority Queue | min-pq-cpp | ||||
| STL priority queue (C++) | stl-pq |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Implementation of HashMap | hashmap-cpp |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Construct binary tree from traversal | construct-binary-tree-cpp | ||||
| Diameter of binary tree | dia-btree-cpp | ||||
| Generic Tree implementation | generic-tree-cpp | generic-tree-java | |||
| Binary Search Tree implementation | bst-cpp | ||||
| Convert linked list to BST | ll-to-bst-cpp | ||||
| Largest BST in a binary tree | largest-bst-cpp | ||||
| Morris traversal of a tree | morris-traversal-cpp | ||||
| Check whether two n-ary trees are mirrors | check-nary-trees | ||||
| STL map (C++) | stl-map | ||||
| STL set (C++) | stl-set | ||||
| Check subtree of a tree | check-subtree-cpp | ||||
| Least Common Ancestor algorithms (Naive, Binary Lifting, RMQ) | lca-algos-cpp |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Heap Implementation | heap-cpp | ||||
| STL priority queue (max heap) | stl-pq-max | ||||
| STL priority queue (min heap) | stl-pq-min | ||||
| Merge two heaps | merge-heaps-cpp |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Disjoint Set Union implementation |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Segment Tree implementation | seg-tree-cpp | ||||
| Lazy Propagation in Segment Tree | seg-lazy-cpp |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Trie implementation | trie-cpp | ||||
| Pattern matching with trie DS | pattern-matching-trie-cpp |
- Iterators and ranges
- Policy-based data structures
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Binary Indexed Trees | bit-cpp | ||||
| Interval Tree | |||||
| Suffix Array | |||||
| Sparse Table | |||||
| Suffix Automation | |||||
| Suffix Tree |
- Heavy-light decomposition
- Treap / Cartesian Tree
- K-d Tree
- Link-cut Tree
- Splay Tree
- Palindromic Tree
- Rope, Dancing Links
- Radix Tree
- Dynamic Suffix Array
References: