Stacks in DSA

Stacks in Python - Complete Guide

Stacks Table of Contents What You Will Learn in This Blog What is a Stack Core Stack Operations Implementing a Stack Implementation 1 – Using a Python List Implementation 2 – Using a Linked List Which Implementation to Use The Call Stack How Python Uses a Stack for Function Calls Stack Overflow Monotonic Stack What is a Monotonic Stack Monotonic Increasing Stack Monotonic Decreasing Stack The Template Time and Space Complexity Patterns and Techniques Pattern 1 – Stack for Matching and Validation Pattern 2 – Stack for State Tracking Pattern 3 – Monotonic Stack Summary Key Takeaways Practice Problems Next Steps What You Will Learn in This Blog What a stack is and the LIFO principle The four core operations: push, pop, peek, and isEmpty Two ways to implement a stack from scratch – using a list and using a linked list How Python uses a stack internally for function calls and recursion What a monotonic stack is and when to reach for it Three problem-solving patterns that use stacks Solved LeetCode problems with full explanation A practice problem table for further study What is a Stack A stack is a linear data structure that follows the Last In, First Out principle – LIFO. The last element added is the first one to be removed. ...

March 21, 2026 · 19 min · 3920 words ·  · By codeverra
Strings in DSA

Strings in Python - Complete Guide

Strings Table of Contents What You Will Learn in This Blog What is a String ASCII Unicode Strings in Python – Immutability String Operations and Time Complexity Common String Methods Strings as Arrays Patterns and Techniques Pattern 1 – Two Pointers on Strings Pattern 2 – Sliding Window on Strings Pattern 3 – Hashing for String Problems Summary Key Takeaways Practice Problems Next Steps What You Will Learn in This Blog What a string is at the byte level – characters, ASCII, and Unicode How Python represents strings in memory Why strings in Python are immutable and what that means in practice All common string operations and their time complexity How to build strings efficiently and avoid a common O(n^2) trap Three patterns applied to strings: Sliding Window, Two Pointers, and Hashing Solved LeetCode problems for each pattern with full explanation A practice problem table for further study What is a String At the most fundamental level, a string is a sequence of characters. But computers do not natively understand characters – they only understand numbers. So every character is mapped to a number, and that number is stored in memory. ...

March 21, 2026 · 20 min · 4117 words ·  · By codeverra
The Complete DSA with Python Master Roadmap

The Complete DSA with Python - Master Roadmap

The Complete DSA with Python – Master Roadmap What This Guide Is A hands-on, no-nonsense guide to learning Data Structures and Algorithms using Python. The goal is to build genuine understanding, not to memorise solutions. Every topic covers: The concept from first principles Python implementation with full code and complexity analysis The common patterns and techniques that come from that data structure Hands-on LeetCode problems tied directly to the topic What You Need Before Starting Basic Python: variables, loops, conditionals, functions, lists, dicts No prior DSA knowledge needed. Everything else is explained from scratch. The Roadmap Part 1 – Foundation Blog What You Will Learn What is DSA and why do we learn it What data structures and algorithms are, why they matter, how this guide is structured How to use this guide and how to practice Learning philosophy, how to approach problems, how to use LeetCode effectively Python refresher for DSA Lists, dicts, sets, tuples, list comprehensions, functions – the Python tools you will use constantly Part 2 – Complexity Analysis Before touching any data structure, you need this vocabulary. Every single blog after this uses it. ...

March 21, 2026 · 5 min · 1039 words ·  · By codeverra
Two Pointers Pattern

Two Pointers Pattern - Complete Guide

🔰 Pattern 1: Two Pointers Table of Contents What is the Two Pointer Technique? When to Use Two Pointers? Types of Two Pointer Patterns Visual Walkthrough Template Code Problem Set Problem 1: Two Sum II – Input Array Is Sorted Problem 2: Valid Palindrome Problem 3: Remove Duplicates from Sorted Array Problem 4: Container With Most Water Problem 5: 3Sum Problem 6: Trapping Rain Water Problem 7: Sort Colors (Dutch National Flag) Problem 8: Move Zeroes Problem 9: Squares of a Sorted Array Problem 10: Merge Sorted Array Key Takeaways & Summary What is the Two Pointer Technique? Two Pointers is a technique where you use two index variables that move through an array or string - either toward each other from opposite ends, or in the same direction at different speeds - to solve a problem efficiently. ...

March 21, 2026 · 36 min · 7464 words ·  · By codeverra
What is DSA

What is DSA and Why Do We Learn It

What is DSA and Why Do We Learn It Table of Contents What You Will Learn in This Blog What is a Data Structure What is an Algorithm Why Do We Learn DSA How This Guide is Structured How to Practice – The Right Way The Problem-Solving Framework How to Use LeetCode Common Mistakes to Avoid What You Need Before Continuing Summary Key Takeaways Next Steps What You Will Learn in This Blog What data structures are and why they exist What algorithms are and how they relate to data structures Why learning DSA makes you a better problem solver How this guide is structured and how to navigate it How to practice effectively – LeetCode strategy, problem-solving framework, and common mistakes to avoid What is a Data Structure When you write a program, you are almost always working with data. You store it, retrieve it, update it, and delete it. A data structure is simply a way of organising that data so that your program can work with it efficiently. ...

March 21, 2026 · 9 min · 1897 words ·  · By codeverra
DSA learning roadmap

A Practical DSA Learning Roadmap

Data Structures and Algorithms (DSA) are often treated as a necessary evil, something you grind through only to clear technical interviews. This narrow framing has done more harm than good. It leads to shallow learning, memorized solutions, and frustration when problems slightly change. The truth is simple: DSA is not just about interviews. It is about learning how to think clearly, reason about efficiency, and design solutions that scale. This blog lays out: ...

December 30, 2025 · 5 min · 886 words ·  · By codeverra
Analysis of time complexity

Analysis of Time Complexity Explained with Python Examples

Time complexity is one of the most important concepts in Data Structures and Algorithms. It helps you understand how an algorithm behaves as the input size grows and why some solutions fail to scale. This guide explains time complexity step-by-step using simple explanations and Python examples written purely as text, focusing on intuition rather than heavy mathematics. 1. What Is Time Complexity? Time complexity measures how the running time of an algorithm grows as the input size increases. ...

December 30, 2025 · 4 min · 784 words ·  · By codeverra
Array problem-solving patterns

Array Patterns for Problem Solving

Array patterns are recurring problem-solving techniques used to solve a wide variety of array problems efficiently. Instead of memorizing individual solutions, understanding these patterns helps you recognize how to approach a problem and design an optimal solution. 1. Traversal Pattern Concept The traversal pattern involves visiting each element of the array once or in a fixed manner. When to Use Finding maximum or minimum elements Printing all elements Counting frequency Simple condition checks Explanation Example Traverse the array from the first element to the last, updating the required result as you move forward. ...

December 30, 2025 · 4 min · 715 words ·  · By codeverra
BFS vs DFS graph traversal

BFS vs DFS Explained Clearly

Graphs and trees are non-linear data structures. To process or explore them, traversal algorithms are used. The two most important traversal techniques are: Breadth-First Search (BFS) Depth-First Search (DFS) Both algorithms visit all nodes in a graph or tree, but their strategies and use-cases differ significantly. 1. Breadth-First Search (BFS) Concept Breadth-First Search explores a graph level by level. It visits all neighbors of a node before moving deeper into the graph. ...

December 30, 2025 · 3 min · 630 words ·  · By codeverra