dsa
17 tutorials tagged “dsa”.
- Time and Space Complexity (Big-O) in JavaBig-O notation describes how the time or memory a program needs grows with its input. Learn O(1), O(log n), O(n), O(n log n) and O(n²) with counted steps.
- Trees and Binary Search Trees in JavaA binary search tree keeps smaller keys on the left and larger keys on the right, giving fast search. Build insert, search, traversals and height in Java.
- Binary Search in JavaBinary search finds a value in a sorted array by halving the range each step. Learn the loop and recursive versions, O(log n) and Arrays.binarySearch.
- Bubble Sort in JavaBubble sort repeatedly swaps neighbors that are out of order until the array is sorted. Learn the algorithm, the early-exit version and its O(n²) cost.
- Dynamic Programming Basics in JavaDynamic programming solves overlapping subproblems once and reuses the answers. Learn memoization and tabulation with Fibonacci and coin change in Java.
- Graphs in Java: BFS and DFSA graph is a set of nodes joined by edges. Learn adjacency lists, breadth-first search with a queue, depth-first search with recursion, and BFS shortest paths.
- Hashing and Hash Tables in JavaA hash table stores key-value pairs in buckets chosen by the key's hash code, giving O(1) lookups on average. Build one with chaining and resizing from scratch.
- Heaps in JavaA heap is a tree stored in an array where every parent is smaller than its children, so the minimum is on top. Build add and poll, then use PriorityQueue.
- Insertion Sort in JavaInsertion sort builds a sorted part one element at a time, sliding each into place. Learn the algorithm, why it is fast on nearly sorted data, and O(n²).
- Linear Search in JavaLinear search checks each element in turn until it finds the target. Learn the algorithm, a generic version, its O(n) cost and when it is the right choice.