Archives
All the articles I've archived.
-
DFS vs BFS: Complete Comparison With C++ Code, Examples & Use Cases
DFS vs BFS on one graph: stack vs queue, traversal order, O(V + E) time, memory, shortest paths, cycle detection and connected components, with C++ code.
-
What Are DFS and BFS? A Visual Beginner's Guide to Graph Traversal (C++)
What is DFS and BFS? A visual beginner's guide to graphs, stacks and queues, with DFS and BFS traced step by step on one graph and simple C++ code.
-
Binary Search Tree (BST) Questions for University Exams in Bangladesh: Construction, Deletion & Viva (With Answers)
BST exam questions for CSE students in Bangladesh: build a binary search tree from a sequence, traversals, all three deletion cases, pseudocode, viva answers.
-
Tree Questions for University Exams in Bangladesh: Written, Lab & Viva (With Answers)
Tree questions for university exams in Bangladesh with model answers: traversals, building a tree from traversals, recursive and iterative algorithms, viva.
-
Most Common Binary Search Tree (BST) Interview Questions (With C++ Solutions)
20 BST interview questions with tested C++: validate BST, kth smallest, LCA, floor and ceil, recover BST, BST to linked list and largest BST subtree.
-
Most Common Tree Interview Questions (With C++ Solutions)
Tree interview questions from easy to hard: height, diameter, LCA, symmetric, balanced, build from traversals and serialize, with tested C++ solutions.
-
Binary Search Tree (BST) in C++: Search, Insert, Delete & Complete Guide
Binary search tree in C++: the BST property, search, insert, all three deletion cases with diagrams, successor, validation and complexity, with tested code.
-
Trees, Binary Trees & Tree Traversals in C++: Complete Beginner's Guide
Binary tree in C++: terminology, full vs complete vs perfect trees, building a tree, and inorder, preorder, postorder and level order traversal.
-
Queue vs Stack in C++: LIFO vs FIFO, STL & Practical Comparison
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.
-
Top 5 Famous Queue Problems in Competitive Programming (With C++ Solutions)
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.
-
Queue Implementation Using Linked List in C++: Dynamic Pointers Guide
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.
-
Queue Implementation Using Vector in C++: Operations & O(n) Erase Analysis
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.
-
Queue Implementation Using Array in C++: Linear & Circular Queue Guide
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.
-
Understanding Queue in C++: Complete Beginner's Guide
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.
-
Top 5 Famous Stack Problems in Competitive Programming (With C++ Solutions)
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.
-
Stack Using Linked List in C++: Dynamic Node & Pointer Implementation
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.
-
Stack Using Array in C++: Fixed-Size Implementation, Overflow & Dry Run
Updated: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.
-
Stack Using Vector in C++: Step-by-Step Class Implementation
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.
-
Stack in C++: Complete Beginner's Guide
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.
-
Namespaces in C++: Scope Resolution, Name Collisions, and Best Practices
Understand namespaces in C++ the easy way. Learn how to prevent name collisions, use the scope resolution operator (::), navigate nested and anonymous namespaces, and why 'using namespace std;' is dangerous in headers.
-
malloc() in C++: Deep Dive, Memory Mechanics, and Modern Alternatives
Master malloc() in C++: understand dynamic memory allocation, heap mechanics, void* casting, object lifetimes, malloc vs new, calloc, realloc, and safe modern alternatives.
-
Rule of Three, Five and Zero in C++: Resource Management
Master modern C++ resource management. Understand the historical evolution from the Rule of Three to move semantics in the Rule of Five, and why the Rule of Zero is the gold standard.
-
C++ Shallow Copy vs Deep Copy Explained
Understand the vital difference between shallow copy and deep copy in C++. Learn how pointer copying causes double deletion and how to implement custom deep copying.
-
C++ Copy Constructor: How Object Copying Works
Master the C++ copy constructor. Understand copy initialization, why parameters require const references, the difference from operator=, and resource ownership.
-
Composition vs Inheritance in C++: Object Design Trade-Offs
Composition vs inheritance in C++: inheritance models is-a, composition models has-a. Compare coupling, flexibility and reuse, and learn when to use each.
-
Function Overloading vs Function Overriding in C++
Function overloading vs overriding in C++: overloading reuses a name with new parameters at compile time; overriding redefines a virtual function at runtime.
-
C++ Abstraction: Abstract Classes and Pure Virtual Functions
Master abstraction in C++. Learn how pure virtual functions and abstract classes decouple interfaces from implementations using a complete payment gateway system.
-
C++ Polymorphism: Compile-Time vs Runtime Polymorphism
Master polymorphism in modern C++. Understand compile-time vs runtime polymorphism, virtual functions, dynamic dispatch, the override specifier, and virtual destructors.
-
C++ Inheritance: Base Classes, Derived Classes and Access
Learn C++ inheritance from the ground up. Understand base and derived classes, access behavior under public inheritance, constructor call order, and the is-a relationship.
-
C++ Encapsulation: Data Hiding, Getters and Setters
Master encapsulation in C++. Understand how bundling state with behaviors, data hiding, and invariant validation protect your software from state corruption.
-
C++ Constructors and Destructors Explained
Master object lifecycle in C++. Learn default and parameterized constructors, member initializer lists, destructor execution order, and RAII foundations.
-
C++ Classes and Objects: A Beginner's Guide
C++ classes and objects: a class is a user-defined type that groups data and functions, and an object is one instance of it. Learn syntax and access specifiers.
-
Python: Control Flow and Core Data Structures
A comprehensive guide to Python control flow and core data structures covering branching conditionals, loops, lists, tuples, sets, dictionaries, comprehensions, and Big-O performance.
-
Mathematics Formula Cheat Sheet
A mathematics formula cheat sheet for quick lookup: algebra, calculus, trigonometry, coordinate geometry, matrices, probability, statistics and discrete math.
-
Python Fundamentals
A comprehensive guide to Python fundamentals covering architecture, CPython execution model, syntax rules, variables, memory mechanics, data types, operators, and error diagnosis.
-
const in C++: Constants, const Pointers, References, and constexpr
Master const correctness in modern C++. Understand const variables, const references, pointer constness variations, const member functions, and constexpr.
-
Pass by Value vs Pass by Reference in C++: Performance and Mechanics
Pass by value vs pass by reference in C++: a copy versus the caller's own variable. Learn when to use T, T&, const T& or a pointer, with examples.
-
References in C++: Aliases, Memory Mechanics, and Pointers Compared
Master C++ references. Learn how aliases operate in memory, const reference binding, reference vs pointer trade-offs, and how to avoid dangling references.
-
Pointers in C++: Memory Addresses, Dereferencing, and Heap Basics
A comprehensive guide to pointers in modern C++. Understand memory addresses, dereferencing, nullptr, pointer arithmetic, dynamic heap allocation, and memory safety.
-
Strings in C++: std::string vs C-Style Strings and Practical Operations
Master string manipulation in C++. Compare modern std::string with legacy C-style char arrays, learn concatenation, searching, slicing with substr, and input handling.
-
Arrays in C++: Memory Layout, Indexing, and Modern Alternatives
A complete guide to arrays in C++. Understand contiguous memory layouts, zero-based indexing, multidimensional arrays, array decay in functions, and std::array.
-
Functions in C++: Declaration, Scope, Overloading, and Parameters
Master modular programming in C++. Learn function prototypes, definitions, return types, default arguments, function overloading, pass-by-value, and recursion.
-
Loops in C++: for, while, do-while, and Range-Based Iteration
Master iteration in C++. Learn for loops, while loops, do-while loops, range-based for loops, loop control with break and continue, and how to avoid infinite loops.
-
Conditional Statements in C++: if, else if, else, and switch
Master decision-making in C++. Learn if, else if, else, switch-case, modern C++17 init-statements, fallthrough rules, and how to write clean branching logic.
-
C++ Operators: Arithmetic, Logical, Bitwise, and Precedence Explained
A comprehensive guide to C++ operators. Understand arithmetic, assignment, relational, logical, bitwise, and ternary operators, along with precedence and short-circuit evaluation.
-
C++ Input and Output: cin, cout, getline, and Stream Formatting
A complete guide to standard I/O streams in modern C++. Master cin, cout, cerr, endl vs newline, reading multi-word strings with getline, and formatting with iomanip.
-
C++ Variables and Data Types: A Complete Beginner's Guide
Master variables and fundamental data types in modern C++. Understand memory representation, primitive types, modifiers, type casting with static_cast, and scope rules.
-
Part 3: Encapsulation — Protecting Your Data
Encapsulation in Java, step by step: access modifiers, why fields start private, getters and setters, and when a domain method beats a setter.
-
Part 2: Classes and Objects — Building Your First Java Class
Build your first Java class: create objects, access fields and methods, initialize them with constructors, and use this and static members correctly.
-
Mastering std::list in Modern C++: From Architecture to Production-Ready Code
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.
-
Part 1: Object-Oriented Programming in Java: A Complete Story for Students
What object-oriented programming is and why it exists: the trouble with procedural code, objects as real-world models, and the four pillars of OOP in Java.
-
Binary number conversions
Master binary number conversions between binary, decimal, octal, and hexadecimal systems with step-by-step methods and solved examples.
-
How I Cut My Palindrome Algorithm’s Execution Time in Half
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%.
-
Data Structure in C: 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.
-
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.