Tag: data-structures
All the articles with the tag "data-structures".
-
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.
-
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.