
Define a data structure as data organized with operations over it, from static arrays to dynamic vectors, and review built-in structures in C++ like STL vector, stack, and queue.
Why data structures matter: maps and hash tables, plus tries and suffix trees, enable efficient data access and performance beyond built-in arrays for real-world problems.
From Algorithms course, but the same perspective.
Explore vectors as dynamic arrays built from pointers, and implement a simple vector class with a constructor, destructor, size management, and operations like print and find.
Learn how the append (push_back) operation grows a dynamic array, including reallocation by copying data, pointer swaps, and the impact on linear versus quadratic time performance.
Learn how the capacity trick accelerates vector push backs by doubling vector's capacity and moving data far less often, and apply root cause analysis to diagnose quadratic performance.
learn how to insert a value into a vector by expanding capacity when full, shifting elements right from end to index, and updating size, with worst-case linear time.
Define abstract data type as a what-focused concept that hides how, and contrast it with data structures and implementation details; illustrate with vector ADT as the public interface.
Extend a vector from integers to strings using template programming, while addressing memory management with raw pointers, copy constructors, and the trade-offs with smart pointers.
Implement vector operations such as right_rotate and left_rotate to rotate the array in place, even for large counts, and add pop by index with transposition-based search.
Master the vector homework by implementing right rotation without expanding capacity, using a temporary value and back-to-front shifting; learn left rotation and modulus-based cycle elimination for efficiency.
Explore how asymptotic complexity estimates time and memory by focusing on large inputs and ignoring constants, using big-o notation to identify the dominant term.
Explore practical methods to determine asymptotic complexity from code, focusing on dominant terms and ignoring constants. Analyze loops—single, nested, and parallel—and map them to O(1), O(n), and higher orders.
Understand how big O provides an upper bound by using a constant and a starting point, dropping constants, and comparing n-based growth in practice.
Analyze time and memory complexity, focusing on worst-case bounds and auxiliary space. Use O(n) and O(n^2) examples and discuss memory management and reference versus value passing.
Introduces the linked list by building nodes with data and a next pointer, showing how linking nodes creates a dynamic structure that avoids large contiguous memory.
Learn to print a singly linked list from the head to null using next pointers, with optional recursive and for-loop variations. Explore a recursive reverse printing approach.
Explore singly linked lists built from nodes with data and next pointers, using head and tail to insert at the end, print safely, and avoid memory leaks.
Traverse means walking through the elements of a data structure, as in linked lists. Implement traversal iteratively with for loops or recursively, using a previous pointer for search and get_nth.
Develop effective coding and debugging for linked lists by using test cases, thinking before coding, and a modular approach to preserve data integrity.
Explore singly linked list operations by implementing a safe destructor, front insert and delete, and get-nth-from-back using length.
Explore three deletion strategies in a singly linked list—removing the first, last, or nth node—emphasizing relinking, head and tail updates, and data integrity in C++.
Explore how logical data structures map to their physical memory layouts. Compare row major and col major array storage, vectors, and heap versus stack, with linked lists using pointers.
Master data structure skills by implementing linked list operations: delete by key, swap consecutive values, reverse by node addresses, remove even positions, and insert into a sorted list.
Learn to manipulate singly linked lists in C++: delete by key and nth node, swap adjacent pairs, and reverse the list with clear utilities and modular, reusable code.
Learn to manipulate a singly linked list by deleting every second node with a delete-next utility and inserting in sorted order using embed-after, handling edge cases in O(n).
Tackle SLL challenges: swap head and tail by addresses, rotate left by k, remove duplicates, move all key occurrences to the back, and implement recursive max with a single function.
Explore singly linked list manipulations: swap head and tail by relinking with addresses, perform left rotations using cycle creation and break, and remove duplicates with a delete-next-node approach.
Implement and explain singly linked list operations: delete the last occurrence, move matching nodes to the end using a tail, and compute max with careful initial values.
Master medium-to-hard SLL challenges: reorder by odd positions, merge lists alternately, and add numbers represented by reversed digits with carry; remove duplicates in sorted list and reverse blocks by key.
Explore linked list manipulation across three problems: relink odd and even positions, insert nodes alternately from two lists, and add numbers represented by lists with carry handling.
Learn to remove all repeated values in a linked list using a dummy head, delete blocks of equal values with move-and-delete, and reverse k-node subchains to re-link the list.
Learn how a doubly linked list adds a previous pointer to enable forward and backward traversal, allowing quick access to the previous node and easier insertions near the tail.
Master the insertion into a doubly linked list: implement insert end, insert front, and insert sorted using a linking function and embed_after to update head, tail, and pointers.
Learn to delete nodes in a doubly linked list, front or end, using delete and link utilities, while maintaining head and tail integrity and optionally returning the previous node.
Learn to delete nodes by key in both doubly and singly linked lists, remove even or odd positions, and implement a palindrome check for list symmetry.
Explore solutions for doubly linked lists, including deleting all nodes with a given key, deleting even and odd positions using a dummy node, and checking palindrome with a known length.
Mastering critical skills in data structures using C++ presents challenges: find the middle of lists, swap nodes by address in doubly linked lists, reverse lists, and merge two sorted lists.
Apply middle-finding in doubly linked lists by handling odd and even lengths with two pointers. Then use the tortoise and hare approach to determine a singly linked list’s length.
Swap the kth node from the front with the kth from the back in a linked list, handling consecutive, same, and head or tail cases using four pointers and linking.
Reverse a singly linked list with incremental left-to-right steps and next-pointer copies to safely swap nodes; apply the same method to maintain connections in a doubly linked list.
Merge two sorted linked lists by always taking the smaller node, using a last pointer initialized to null, then link nodes and handle remaining elements for O(n+m) time.
Master sparse arrays and matrices using a doubly linked list based array linked list, with set, get, print, and add operations.
Create an array-based linked list with sorted indices and a get index helper. Implement print, get, set, and add by merging data with a partner list.
Build a sparse matrix as a linked list of linked lists, reuse the array linked list logic for rows and columns, and apply the same approach to a sparse cube.
Explore the stack data structure, a last-in, first-out ADT, with push, pop, and peek operations, along with is_empty and is_full checks, implemented via array or linked list.
Learn to implement a stack with a dynamic array, using top, push, pop, and peek, plus is full and is empty checks and error-handling considerations.
Explore stack design choices, including added-element top indicators and operations, and assess effects on time, push, pop, and peek. Apply stacks to reversing words, validating parentheses, and two-stack in-one-array design.
Explore stack design trade-offs and time complexity, learning how push and pop operations can shift from O(n) to O(1). Practice reversing subwords and numbers with a stack, and validate parentheses.
Mastering critical skills in data structures using c++ demonstrates validating parentheses with a stack. It explains opening and closing blocks, top matching, and balance for nested expressions.
Adopt a stack-based approach to remove adjacent duplicates and design two stacks in one array by using begin for stack one and end for stack two, achieving O(1) operations.
Explore six stack-based challenges: simulate asteroid collisions, insert at the bottom and reverse a stack recursively, study manual stack simulation, compute parentheses scores, and find next greater elements.
Explore the asteroid collision problem in C++ using a stack to simulate moving and colliding elements, iterating with backtracking to determine survivors and explosions and preparing for interviews.
Learn to reverse a stack using an insert-at-bottom technique, implemented recursively or iteratively, and master tracing recursion by focusing on the what and the goal.
Implement a manual stack to simulate a factorial calculation, pushing and popping stack elements that hold input n and its computed result, including base and recursive cases.
Use a stack to manage nested subproblems created by open parentheses. On close, replace the subexpression with its value (one if empty, otherwise doubled) and pass it to the parent.
Explore a stack-based approach to find the next greater element, using reverse thinking to trace subproblems, with linear time complexity and relevance for interviews.
implement a stack with a linked list and a head pointer by pushing to the front; compare array-based and linked-list stacks and discuss push, pop, and memory flexibility.
Explore infix, postfix, and prefix notation, and learn how precedence and associativity govern evaluation. See how postfix and prefix simplify computation and practice conversion and evaluation concepts using a stack.
Master infix to postfix conversion with a stack, using single-digit operands and binary operators, guided by precedence and left-to-right associativity. Use five rules to build postfix.
Explore infix to postfix conversion with stack-based handling of parentheses, sub-problems, and the impact of precedence, associativity, and the power operator.
Tackle five hard data-structures challenges in C++, including infix to postfix and prefix with power operators, and stack-based postfix evaluation supporting digits and letters, plus delete middle in O(1).
Implement the power operator in the precedence function and adapt for right-to-left associativity. Demonstrate postfix evaluation with a number stack and reverse-based infix-to-prefix conversion, including parentheses handling.
Explore stack implementations on arrays and doubly linked lists, and delete the middle element in O(1) by maintaining a middle pointer. Use a sign-aware stack to handle nested expressions.
Learn the queue data structure with fifo order, enqueue at rear and dequeue from front, compare it to a stack, and review shift-based (O(n)) and front-rear (O(1)).
Implement a circular queue using a circular array with front and rear, plus an added elements counter to distinguish empty from full, enabling efficient enqueue, dequeue, and display.
Learn to implement a queue with a linked list, enqueue at the tail and dequeue from the head, using aggregation and delegation in object-oriented design.
Tackle homework set one by implementing a deque on a circular queue and a queue using two stacks, with a stack built from a queue and O(1) time constraints.
Extend the dequeue problem with front enqueue and rear dequeue. Explore the previous function that wraps the index and compare queue and two-stack implementations with O(1) dequeue.
Implement a priority queue via a circular queue with aggregation, ordering by highest priority without altering underlying queue; tackle three problems including summing the last four numbers in streaming tasks.
Explore a three-queue priority system using Q1, Q2, Q3, with enqueue and dequeue by highest priority, and examine circular queues, sliding windows, and max-k element problems via priority queues.
Master the C++ STL vector, stack, and queue, using templates for generic types, and explore push back, size, and pair usage with make_pair and accessing first and second.
Explore nonlinear data structures by examining trees, including root, nodes, edges, leaves, and subtrees, and compare binary trees, binary search trees, height and depth, and balance variants like AVL.
Explore tree traversal concepts using expression trees, mastering in-order, post-order, and pre-order prints, and learn to recursively print left and right subtrees to produce postfix and prefix notations.
Master the binary tree postorder traversal by implementing a recursive print that outputs left, right, then node data, and learn to trace recursion using induction.
Explore in order, pre-order, and post order tree traversals through detailed recursive tracing, visual techniques, and practical steps for printing and understanding binary trees.
Explore various binary tree types, including full (strict) binary trees, perfect and complete trees, degenerate and balanced trees, and relate internal and leaf nodes, with k-ary generalization.
Explain the key formulas for binary trees, including the perfect tree node count 2^levels minus 1 and height from n, and compare unlabeled versus labeled trees with Catalan numbers.
Learn to build a binary tree automatically with an add function that follows path and direction lists to create left and right subtrees, test with leaves and assertions for consistency.
Implement a binary tree in C++ with functions to find max value, height, node and leaf counts, search values, and check if the tree is perfect recursively and by formula.
Compute maximum and minimum from left and right subtrees, then tally the height, the node counts, and the leaves, and verify a perfect tree.
Implement destructor and clear for binary trees, use a custom stack for iterative inorder, and build postfix-based expression trees with prints for postfix, infix (with parentheses), and prefix.
Master destructor design with a clear function and iterative traversal via a stack and boolean flag; explore boundary traversals, tree diameter, and expression tree printing.
Prints binary tree nodes level by level using a queue to perform breadth first traversal. Covers time complexity O(n) and memory usage.
Implement recursive level-order printing for binary trees, compare with queue-based methods and time complexity, generate a spiral level-order with even levels reversed, and build a complete-tree checker with tests.
Learn recursive level order traversal and its O(n^2) cost, implement a level order spiral with a deque using forward/backward levels and symmetry, and detect a complete tree with a boolean.
Learn how to construct a binary tree from traversals by using preorder with inorder or preorder with postorder, and why inorder is essential for unique reconstruction, with recursive root partitioning.
Implement a binary tree constructor that consumes preorder and inorder deques to generate the tree via recursion, and build a full binary tree using preorder with leaf indicators.
Build a binary tree from preorder and inorder using start and end indices to split left and right subtrees, and construct a full binary tree from preorder by leaf status.
Explore how to serialize and deserialize binary trees by marking nulls with -1 and using complete preorder. Apply parenthesizing and canonicalization to obtain unique representations.
Study symmetric binary trees using a mirror recursive function and a parentheses-based comparison. Explore flip-equivalent trees by swapping subtrees and identify duplicate subtrees with output in parentheses.
Develop recursive and canonical methods to determine tree symmetry, using left-right mirror checks, parentheses-based representations, and sorted hashes to identify duplicate subtrees.
Explore the binary search tree, where left nodes are smaller and right nodes larger, enabling in-order traversal to yield sorted values and building trees from preorder, postorder, or level order.
Insert nodes into a binary search tree with a recursive approach, placing values in the left or right subtree and creating nodes when absent. Explore balance, complexity, successor, and deletion.
Practice iterative and recursive search in trees, compare two BST validation approaches, and build balanced BSTs from sorted arrays while selecting kth smallest elements and exploring the lowest common ancestor.
Compare iterative versus recursive approaches to tree problems, verify BSTs via recursion or in-order sorting, locate the k-th smallest element with early termination, and apply LCA ideas to find paths.
Clarifies how to keep a binary search tree balanced by enforcing per-node minimum and maximum bounds. Updates bounds when moving left or right to preserve balance.
Build a balanced binary search tree from a range by selecting the middle element as root and recursively constructing left and right subtrees.
learn to locate the minimum and the successor in a binary search tree. use two cases: minimum of the right subtree, or climb ancestors until you become a left child.
Explore how to determine a binary search tree successor using in-order traversal, covering right-subtree minimum, and climbing ancestors to find the first left turn, with and without a parent pointer.
Rewrite the binary search tree insert and successor with a parent node, answer ancestor queries on a sorted input, and check preorder to detect a degenerate tree in O(n).
Add a parent pointer to each node to simplify insertion and successor logic by climbing from child to parent, and maintain this relation in constructor setup and during deletions.
Modify in-order traversal to answer ancestor and successor queries by tracking the last visited node, enabling pruning of irrelevant paths and detecting degenerate binary search trees via preorder range checks.
Develop and optimize binary search tree construction from preorder, inorder, and level order traversals using a deque, moving from n square to O(n) with min-max bounds and next greater techniques.
Build binary search trees from preorder and level order traversals using recursive root splits and min-max constraints. Achieve O(n) time with next-greater indices, and level-order with min-max in a queue.
Delete a node from a binary search tree by handling leaf, single-child, and two-children cases, using the successor value replacement and optional lazy deletion for efficiency.
Master BST deletion in C++ by implementing delete node with and without parent links, handling no, one, and two child cases, using min node and successor logic.
Examine the design consequences of bst deletion, including root deletion with a single child, and how a two-class structure avoids self-destruction by copying the child data.
Implement delete in a binary search tree using the node predecessor, avoid recursive deletion, and rewrite the BST with a separate binary node class and a root that is null.
Solve the homework problem by using the predecessor for deletion, avoiding recursion, and connect the child to its parent in the correct left or right direction.
Rewrite the binary search tree using a separate class and struct, covering insert, delete, min node, and queue-based level-order traversal for greater code flexibility.
Almost all other courses focus on knowledge. In this course, we focus on gaining real skills.
Overall:
The course covers basic to advanced data structures
Learn the inner details of the data structures and their time & memory complexity analysis
Learn how to code line-by-line
Source code and Slides and provided for all content
An extensive amount of practice to master the taught data structures (where most other content fails!)
~180 problems from easy to hard!
Content:
Asymptotic Complexity
Vector
Singly Linked List
Doubly Linked List
Project: Sparse Array and Matrix
Stack
Queue
Binary Tree
Binary Search Tree
Binary Heap
AVL Tree
Letter Tree (Trie)
Hash Table
Extensive Homework sets with video solutions
Teaching Style:
Instead of long theory then coding style, we follow a unique style
I parallelize the concepts with the codes as much as possible
Go Concrete as possible
Use Clear Visualization
By the end of the journey
Solid understanding of Data Structures topics in C++
Mastering different skills
Analytical and Problem-Solving skills
Clean coding for data structures
Black-box applying on DS
With the administered problem-solving skills
You can start competitive programming smoothly [DS type]
Smooth start in Algorithms course
One more step toward interviews preparation
Prerequisites
Programming Skills:
Up to arrays & functions
Comfortable with recursive functions
Comfortable with pointers
Basics of OOP: Just Class, Private and Public Sections.
Preferred:
Learning and using STL
Project Building Skills
Basic Programming Problem-Solving Skills
It is going to be a transformative experience. Please read reviews to get a flavour of that. It is not going to be easy work. It will be Stanford-like course. You can skip homework if you want easier or shorter learning experience.
Don't miss such a unique learning experience!