Skip to content
Insight CodeAcademy

DSA

3 articles

DSA6 min read

BFS vs DFS: Which Traversal Should You Use?

In this article we will learn how breadth-first search and depth-first search actually differ, why BFS finds the shortest path in an unweighted graph and DFS does not, how their memory usage compares on wide and deep graphs, and a decision rule for choosing between them in an interview.

DSA7 min read

The Sliding Window Pattern

In this article we will learn what the sliding window pattern is, how it turns an O(n²) brute force into an O(n) scan, the difference between fixed-size and variable-size windows, how to recognise a sliding window problem from its wording, and the mistakes that quietly break the invariant.

DSA8 min read

Time and Space Complexity Explained

In this article we will learn what time and space complexity mean, why Big-O notation drops constants, how to analyse loops and recursion step by step, what auxiliary space is, and how to compare two solutions without ever running them.