DFS vs BFS: Understanding the Differences
Depth-First Search (DFS) and Breadth-First Search (BFS) are two fundamental graph traversal algorithms. Learn how they work, their differences, and when to use each one.
Explore my detailed write-ups on tackling various LeetCode problems, including strategies, solutions, and optimization tips, all organized in chronological order.
Depth-First Search (DFS) and Breadth-First Search (BFS) are two fundamental graph traversal algorithms. Learn how they work, their differences, and when to use each one.
Difference arrays are a powerful tool for efficiently performing range update operations. Learn how difference arrays work, how to implement them, and their applications.
KMP (Knuth-Morris-Pratt) is a string-matching algorithm that searches for occurrences of a "needle" within a "haystack". Learn how KMP works and how to implement it in your code.
Union-Find is a data structure that keeps track of a partition of a set into disjoint subsets. Learn how Union-Find works and how to implement it in your code.