
Master data structures and algorithms for interviews using c++ from basics to complex problems, with hands-on examples that build problem-solving skills.
After completing this lecture, you will be able to setup a coding environment on your system. We will proceed with the same coding environment for the whole duration of this course.
Explore c++ as an object oriented programming language and a practical tool for data structures and algorithms. Build a skeleton program, learn include statements, main, and return zero.
Explore data types in C++, including numeric types such as int, long, and long long, and decimal types like float and double, plus text types like string and char.
Learn to implement conditional statements in c plus plus, focusing on if else and switch constructs, using conditions, else if, and else, cases, break, default, and cout.
Explore looping statements in C++ by building a for loop to print numbers using cout, compare while and do-while structures, and understand initialization, condition, and increment mechanics.
Explore how functions work in c++ by examining syntax, return types, and parameter passing. Learn four function types: void, return, parameterized, and non-parameterized, through an add example reused in main.
Analyze time and space complexity to choose the best algorithm, using big O, omega, and theta notations. Understand auxiliary and input space, and apply to simple loops to estimate growth.
Build a C++ program skeleton using iostream and std, and handle int, float, and string inputs. Practice control flow with if, switch, and loops (for, while, do-while) in a lab.
Explain the C++ STL components—algorithms, containers, functions, and iterators—focusing on arrays and 2D arrays, their contiguous memory, zero-based indexing, and element access.
Explore pairs, vectors, and iterators in C++: create and access pair elements via first and second, and perform common vector operations and traversal.
Explore C++ containers list, stack, queue, deque, and priority queue, mastering core operations like pushback, push front, pop, and front; understand FIFO, LIFO, and priority ordering.
Explore set, multiset, and unordered set concepts in C++: sets store unique, sorted elements; multisets allow duplicates; unordered sets follow input order. Use insert, erase, and find to manipulate.
Explore maps, multimaps, and unordered maps in C++ by storing key-value pairs with unique or sorted keys, and learn basic operations and access patterns for practical data organization.
Linked lists are non-contiguous, ordered structures of nodes with a value and a next pointer, with a head and tail, enabling insertion and deletion in constant time.
Explore predefined C++ functions such as sort, pop count, next_permutation, max_element, and min_element. Learn to sort ascending or descending and generate permutations from a sorted list while counting set bits.
Demonstrates implementing C++ containers: arrays, vectors, sets, multisets, maps, and unordered variants, inputting, manipulating, and printing data with pairs, iterators, and common operations.
Explore recursion as a foundational algorithm in competitive programming, an alternative to iteration, and learn how base conditions terminate calls to prevent stack overflow.
Explore recursion with a concrete factorial example, showing how factorial(n) calls factorial(n-1) until the base case when n equals one, and how termination occurs.
Compare linear search and binary search intuition using recursion on a sorted array. It covers pointers and mid index, the recursive approach, pseudocode, and O(log n) time with O(1) space.
Demonstrates how bubble sort sorts an array into ascending order by repeatedly swapping adjacent elements, with a dry run and pseudocode, and covers time and space complexities alongside sorting algorithms.
Explore bubble sort time and space complexities, deriving that the worst-case time is O(n^2) and best-case is O(n), with constant space O(1) due to in-place swaps.
learn how selection sort, an alternative to bubble sort, selects the smallest element from the unsorted portion and swaps it into the sorted portion, with pseudocode and complexity notes.
Explore the time and space complexities of selection sort. Learn why its worst-case time is O(n^2) and how it uses only constant extra space (O(1)) with in-place sorting.
Learn insertion sort by moving values from the unsorted part into the correct position in the sorted part, illustrated with a live example and its pseudocode.
Explore the time and space complexities of insertion sort, including worst-case O(n^2) when the array is in reverse order, best-case O(n) for a sorted array, and constant auxiliary space.
Explore how merge sort uses divide and conquer to split an array into subarrays and merge them in ascending order, with pseudocode and a preview of time and space complexity.
Merge sort uses divide and conquer to achieve O(n log n) time, with the merge step costing O(n). It uses linear space for the subarrays.
Discover how dynamic programming reduces time and space complexity compared to recursion, and learn memoization, tabulation, top-down and bottom-up approaches, plus space optimization to constant space.
Learn dynamic programming on a one-dimensional dp array by solving fib n with recursion, then memoization, then tabulation, and finally space optimization to constant space.
Learn dynamic programming on 2D grids by counting all paths from the top-left to bottom-right, using recursive, memoization, and tabulation, with space optimization.
Explore the basics of trees and graphs, define root, leaves, children, and parent, and explain subtree as a part of a hierarchical data structure of nodes.
Explore tree types from binary to n-ary, including at most two or three children, and master binary search tree properties that direct searches and reduce comparisons.
Define graphs by nodes (vertices) and edges, distinguishing undirected and directed edges. Explain paths with a start node and no repetition, note cycles, and compare degree, indegree, and outdegree.
Explore storing graphs in memory using adjacency matrix and adjacency list, illustrating undirected and directed graphs, nodes, edges, and weights versus unit distances.
Explore traversal techniques for trees and graphs, focusing on BFS (breadth-first, level-order) and DFS (preorder, inorder, postorder). The lecture demonstrates each method with examples and discusses their time complexity O(V+E).
Contents: 1 course.
Levels: Beginner, Intermediate and advanced
Course 1: Learn data structures and algorithms for interviews
Tried Learning Data Structures and Algorithms?
Was it all in bits and pieces?
Then now you are in the right place. Here no material is in bits and pieces because we have focused on a total journey from a newbie to a well trained problem solver. We have gone through all topics needed for a solid concept and then we will be going more into the practical side. Once you have mastered DSA there is no getting back from excellence in your career. Allow me to present the beauty of DSA and programming through this course.
This course is made for people who want to learn DSA from A to Z in a well-organized and structured manner. We just don’t teach the basics, we cover all the varieties, and we go in super depth for each topic, so that you are well prepared for any of your interviews.
We cover the fundamentals of C++ programming language required for solving problems on various coding platforms like Leetcode. We start with the basic data structures like arrays, linked lists, stacks, queues and various algorithms associated with these data structures like sorting and searching. We then move onto the advanced concepts like Dynamic programming and trees required for solving harder problems.