# Data Structures & Algorithmic Engineering

> Essential data structures, memory layouts, algorithmic problem solving, and computational complexity.

- Canonical URL: https://shafinchowdhury.dev/topics/dsa/
- Author: Shafin Chowdhury (https://shafinchowdhury.dev/about/)

Data structures and algorithms form the core problem-solving toolset for software developers. Here you will find rigorous examinations of linear data structures, pointer-based collections, digit-level algorithmic optimizations, and radix conversions.

## Curated Learning Path

1. **[Beginner]** [Dynamic Memory & Pointer Allocation](https://shafinchowdhury.dev/posts/dynamic-memory-allocation/) ([Markdown](https://shafinchowdhury.dev/posts/dynamic-memory-allocation.md)) — The prerequisite memory model behind dynamically sized data structures and heap allocations.
2. **[Beginner]** [The Queue Data Structure in C](https://shafinchowdhury.dev/posts/queue/) ([Markdown](https://shafinchowdhury.dev/posts/queue.md)) — FIFO principles, array-based circular buffers, dynamic queues, and production C implementations.
3. **[Intermediate]** [Linked Lists: std::list in Modern C++](https://shafinchowdhury.dev/posts/list-in-cpp/) ([Markdown](https://shafinchowdhury.dev/posts/list-in-cpp.md)) — Non-contiguous node chains, O(1) insertions/deletions, iterator validity, and pointer linkage.
4. **[Intermediate]** [Algorithmic Number Manipulation & Optimization](https://shafinchowdhury.dev/posts/efficient-palindrome-code/) ([Markdown](https://shafinchowdhury.dev/posts/efficient-palindrome-code.md)) — High-performance numerical algorithms, reducing time complexity and eliminating allocation bottlenecks.
5. **[Beginner]** [Radix Number Systems & Binary Conversions](https://shafinchowdhury.dev/posts/binary-number-conversions/) ([Markdown](https://shafinchowdhury.dev/posts/binary-number-conversions.md)) — Positional notation, bit-level foundations, and algorithmic conversions between bases.

## Articles by Category

### Linear Data Structures

Stacks, queues, lists, and node-based sequential representations.

- [Stack in C++: Complete Beginner's Guide](https://shafinchowdhury.dev/posts/understanding-stack-in-cpp/): A stack in C++ stores elements in LIFO order, so push, pop and top all work on one end. Learn each operation and std::stack with a full example. ([Markdown](https://shafinchowdhury.dev/posts/understanding-stack-in-cpp.md))
- [Stack Using Vector in C++: Step-by-Step Class Implementation](https://shafinchowdhury.dev/posts/stack-using-vector-in-cpp/): Learn how to implement a Stack using std::vector in C++. Includes visual diagrams, step-by-step explanations of push_back, pop_back, and back, a complete C++ class implementation, and complexity analysis. ([Markdown](https://shafinchowdhury.dev/posts/stack-using-vector-in-cpp.md))
- [Stack Using Array in C++: Fixed-Size Implementation, Overflow & Dry Run](https://shafinchowdhury.dev/posts/stack-using-array-in-cpp/): Implement a stack using an array in C++: why top starts at -1, push and pop, overflow and underflow checks, full code with output, and a step-by-step dry run. ([Markdown](https://shafinchowdhury.dev/posts/stack-using-array-in-cpp.md))
- [Stack Using Linked List in C++: Dynamic Node & Pointer Implementation](https://shafinchowdhury.dev/posts/stack-using-linked-list-in-cpp/): Learn how to implement a Stack using a singly linked list in C++ from scratch. Understand Node structs, the top pointer, dynamic memory allocation with new and delete, destructor cleanup, visual pointer diagrams, and array vs linked list trade-offs. ([Markdown](https://shafinchowdhury.dev/posts/stack-using-linked-list-in-cpp.md))
- [Understanding Queue in C++: Complete Beginner's Guide](https://shafinchowdhury.dev/posts/understanding-queue-in-cpp/): Learn the Queue data structure in C++ from scratch. Understand the FIFO (First-In, First-Out) principle, core Queue operations (enqueue, dequeue, front, rear, empty, size), std::queue in C++ STL, real-world examples, and time complexity. ([Markdown](https://shafinchowdhury.dev/posts/understanding-queue-in-cpp.md))
- [Queue Implementation Using Array in C++: Linear & Circular Queue Guide](https://shafinchowdhury.dev/posts/queue-using-array-in-cpp/): Learn how to implement a Queue from scratch using a fixed-size array in C++. Master front and rear index management, enqueue and dequeue operations, Queue Overflow and Underflow, visual dry runs, linear Queue limitations, and Circular Queue improvements. ([Markdown](https://shafinchowdhury.dev/posts/queue-using-array-in-cpp.md))
- [Queue Implementation Using Vector in C++: Operations & O(n) Erase Analysis](https://shafinchowdhury.dev/posts/queue-using-vector-in-cpp/): Learn how to implement a Queue using std::vector in C++. Build a custom Queue class with push_back(), erase(), and front(), understand why vector.erase(vector.begin()) takes O(n) time, and learn O(1) alternative strategies. ([Markdown](https://shafinchowdhury.dev/posts/queue-using-vector-in-cpp.md))
- [Queue Implementation Using Linked List in C++: Dynamic Pointers Guide](https://shafinchowdhury.dev/posts/queue-using-linked-list-in-cpp/): Learn how to implement a Queue using a singly linked list in C++. Master Node structs, front and rear pointers, dynamic memory allocation with new and delete, empty queue edge cases, destructor cleanup, visual pointer diagrams, and Array vs Linked List trade-offs. ([Markdown](https://shafinchowdhury.dev/posts/queue-using-linked-list-in-cpp.md))
- [Queue vs Stack in C++: LIFO vs FIFO, STL & Practical Comparison](https://shafinchowdhury.dev/posts/queue-vs-stack-in-cpp/): Understand the difference between Queue and Stack in C++. Compare FIFO vs LIFO ordering, insertion and deletion ends, accessible elements, std::queue vs std::stack in C++ STL, visual element traces, time complexity, and when to use each. ([Markdown](https://shafinchowdhury.dev/posts/queue-vs-stack-in-cpp.md))
- [Data Structure in C: Queue](https://shafinchowdhury.dev/posts/queue/): Learn the queue data structure in C: FIFO order, front and rear, enqueue and dequeue, the types of queues, and a complete array-based implementation. ([Markdown](https://shafinchowdhury.dev/posts/queue.md))
- [Mastering std::list in Modern C++: From Architecture to Production-Ready Code](https://shafinchowdhury.dev/posts/list-in-cpp/): This guide explains how std::list works like a chain of nodes linked together in memory. It uses simple steps and clear code examples to show how to add, find, update, and delete items using modern C++ features. Lastly, it shares easy tips on when to use this container and how to avoid mistakes that slow down your program. ([Markdown](https://shafinchowdhury.dev/posts/list-in-cpp.md))

### Memory & Pointers

Dynamic heap management and pointer architectures.

- [Dynamic Memory Allocation](https://shafinchowdhury.dev/posts/dynamic-memory-allocation/): Dynamic memory allocation in C explained: how malloc(), calloc(), realloc() and free() from <stdlib.h> work, with syntax and runnable code examples. ([Markdown](https://shafinchowdhury.dev/posts/dynamic-memory-allocation.md))

### Algorithmic Problem Solving

Techniques for runtime reduction, monotonic stacks, BFS queues, digit manipulation, and radix arithmetic.

- [Top 5 Famous Stack Problems in Competitive Programming (With C++ Solutions)](https://shafinchowdhury.dev/posts/top-5-stack-problems-in-cpp/): Master the 5 most famous Stack problems in competitive programming and coding interviews: Valid Parentheses, Min Stack, Next Greater Element, Daily Temperatures, and Largest Rectangle in Histogram—complete with C++ code, dry runs, and monotonic stack diagrams. ([Markdown](https://shafinchowdhury.dev/posts/top-5-stack-problems-in-cpp.md))
- [Top 5 Famous Queue Problems in Competitive Programming (With C++ Solutions)](https://shafinchowdhury.dev/posts/top-5-queue-problems-in-cpp/): Master the 5 most famous Queue and Deque problems in competitive programming and coding interviews: Implement Queue Using Stacks, Number of Recent Calls, Binary Tree Level Order Traversal, Rotten Oranges (BFS), and Sliding Window Maximum (Monotonic Deque)—complete with C++ code and dry runs. ([Markdown](https://shafinchowdhury.dev/posts/top-5-queue-problems-in-cpp.md))
- [How I Cut My Palindrome Algorithm’s Execution Time in Half](https://shafinchowdhury.dev/posts/efficient-palindrome-code/): A student-friendly guide to writing highly efficient palindrome functions in C++. Move from slow string conversions to a raw arithmetic method that speeds up your code by 200%. ([Markdown](https://shafinchowdhury.dev/posts/efficient-palindrome-code.md))
- [Binary number conversions](https://shafinchowdhury.dev/posts/binary-number-conversions/): Master binary number conversions between binary, decimal, octal, and hexadecimal systems with step-by-step methods and solved examples. ([Markdown](https://shafinchowdhury.dev/posts/binary-number-conversions.md))
