Category
Algorithm
- Nov 3, 2024
Shrinking the Search Space with Binary Search
Binary search is an efficient searching technique based on the divide-and-conquer principle. By repeatedly narrowing the search space, it guarantees a worst-case time complexity of O(log n). It is well-suited for sorted data, monotonic arrays, and optimization problems where the goal is to find the best value. Common use cases include exact matching, boundary and insertion point searches, finding the closest element, and performing binary search on the answer space.
#BinarySearch - Oct 23, 2024
Solving Problems with the Two-Pointers Technique
The two-pointer technique is essential for optimizing operations on arrays, strings, and lists, often reducing time complexity from O(n²) to O(n). Common patterns include opposing pointers, sliding windows, fast–slow pointers, and dual-input pointers—each suited to different problem types such as finding pairs, subarrays, or merging sorted lists.
#TwoPointers - Sep 27, 2024
Topological Sorting Explained: Sorting Dependency Chains
#Topological Sort#Graph - Sep 18, 2024
Implementing Efficient Prefix Search with Tries
Prefix search is a fundamental operation in computer science, typically implemented using a Trie (prefix tree). A Trie is a dynamic data structure for storing a collection of strings, supporting efficient insertion, lookup, and enumeration operations. Tries and their variants provide a powerful and efficient way to manage and query large volumes of string data.
#Tree#Recursion#Tries#Prefix - Sep 4, 2024
Depth-First Search: Exploring Deep Before Wide
#DFS#Tree#BinaryTree#Graph - Aug 20, 2024
Breadth-First Search: Level-Order Exploration
#Tree#Graph#BFS#Dijkstra - Nov 26, 2024
Understanding Recursion: Functions That Call Themselves
Recursion is a core computational concept where a problem is solved by calling itself on smaller instances. Recursion is key to many algorithms: DFS (Depth-First Search) is often implemented recursively, Dynamic Programming is fundamentally recursion with caching (memoization), and Divide & Conquer uses recursion to split problems into independent subproblems.
#Recursion#DFS#Dynamic Programming#Divide & Conquer