Data Structure | Add/Insert | Remove/Delete | Access/Get | Search/Contains | Space Complexity |
---|---|---|---|---|---|
Array | O(n) |
O(n) |
O(1) |
O(n) |
O(n) |
Queue | O(1) |
O(1) |
O(n) |
O(n) |
O(n) |
Stack | O(1) |
O(1) |
O(n) |
O(n) |
O(n) |
HashSet | O(1) |
O(1) |
- | O(1) |
O(n) |
HashMap | O(1) |
O(1) |
O(1) |
O(1) |
O(n) |
Singly LinkedList | O(1) |
O(1) |
O(n) |
O(n) |
O(n) |
Doubly LinkedList | O(1) |
O(1) |
O(n) |
O(n) |
O(n) |
Circular Singly LinkedList | O(1) |
O(1) |
O(n) |
O(n) |
O(n) |
Circular Doubly LinkedList | O(1) |
O(1) |
O(n) |
O(n) |
O(n) |
Binary Search Tree | O(log n) |
O(log n) |
O(log n) |
O(log n) |
O(n) |
Binary Min Heap | O(log n) |
O(log n) |
O(1) |
O(n) |
O(n) |
Binary Max Heap | O(log n) |
O(log n) |
O(1) |
O(n) |
O(n) |
Sort Algorithm | Best | Average | Worst | Space Complexity |
---|---|---|---|---|
Selection Sort | O(n^2) |
O(n^2) |
O(n^2) |
O(1) |
Insertion Sort | O(n) |
O(n^2) |
O(n^2) |
O(1) |
Quick Sort | O(n log n) |
O(n log n) |
O(n^2) |
O(n) |
Merge Sort | O(n log n) |
O(n log n) |
O(n log n) |
O(n) |
- Aditya Verma
- NeetCode
- Jenny
- Striver
- Jenny
- Tushar Roy
- Kunal Kushwaha
- Vishal Rajput
- MIT OCW - Introduction to Algorithms
- Data Structures by Code School
- Harvard’s CS50
- TheCherno - C++ Tutorials
- freeCodeCamp
- Errichto's
- Gaurav Sen's
- Rachit Jain's
- Anuj
- Khushboo Chaurasiya
- work@tech
- Striver (A-Z)
- Striver
- Love Babbar
- GeeksforGeeks
- Siddharth Singh
- Fraz
- Arsh Goyal
- CodeSkool
- BroCode
- PepCoding
- PepCoding (A-Z)
- Kamal Dhull
- Vivekanand Khyade
- BacktoBack SWE
- Tech Dose
- Geeks for Geeks - Great resource for almost everything DSA
- Tutorials Point
- CppReference - Quick Reference for C and C++ library and other features
- Class Central - Get all details about courses
- https://hackr.io/tutorials/learn-data-structures-algorithms
- https://algorithms.openmymind.net/
- https://visualgo.net/en
Repositories
- Programming E Books
- https://github.com/TheAlgorithms
- https://github.com/trekhleb/javascript-algorithms
- https://github.com/the-akira/Computer-Science-Resources
- https://github.com/ossu/computer-science
Articles
- Become Master In Linked List
- To Queue Or Not To Queue
- Stacks and Overflows
- Taking Hash Tables Off The Shelf
- Learning to Love Heaps
- Become Master In Recursion
- Become Master in Tree
- Trying to Understanding Tries
- Powerful Ultimate Binary Search Template
- 10-line template that can solve most 'substring' problems
- Less Repetition, More Dynamic Programming
- A Gentle Introduction To Graph Theory
- DFS Traversal - Deep Dive through a Graph
- BFS Traversal - Going Broad In A Graph
- Finding The Shortest Path, With A Little Help From Dijkstra
- https://www.geeksforgeeks.org/how-can-one-become-good-at-data-structures-and-algorithms-easily/
Books
- Data Structures and Algorithm Made Easy -Narasimha Karumanchi
- Classic Data Structures -Debasis Samanta
- Introduction to Algorithm -Thomas H.Cormen, Clifford Stein
- Grokking Algorithms -Aditya Bhargava
- 📒 Segment Tree | HackerEarth
- 📕 Dynamic Programming | HackerEarth)
- 📒 Disjoint Set Union (Union Find) | HackerEarth
- 📕 Ternary Search | HackerEarth
- 📒 Binary Search for Beginners | Leetcode
- Introduction to Algorithms - Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein
- Competitive Programming 3 - Steven Halim, Felix Halim
- Competitive Programmer’s Handbook - Antti Laaksonen
- Awesome List of CP related stuff
- Tutorials List 1
- Tutorials List 2
- Luv Kumar CP Playlist
- List of CP Books
- CP Handbook
- Advanced Number Theory
- Mobius and Arithmetic Functions
- Mobius Inversion
- Mobius Inversion Slides
- Dirchlet Convolution
- Posets and Hall Marriage Theorem
- Line Sweep
- Trie
- Centroid Decomposition
- Generating Functions
- Rotating Callipers
- Dp optimizations 1
- Dp Optimizations 2
- Sqrt Decomposition
- Anti Hash Tests
- Mo's algorithm on Trees
- Xor-FFT
- Factorial-Modulo-Prime Trick
- Wavelet Trees
- Segment Tree Beats
- BerleKamp-Massey Algorithm
- Parallel Binary Search
- Policy Based Data Structures
- Matroid Intersection
- Maximum Antichain of Poset
- Sliding Window-StackQueue Trick
- Dfs Tree
- CP Templates