
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Data structures and algorithms level-up course equips you with essential problem-solving through curated problems across arrays, stacks, trees, graphs, and dynamic programming, plus practice and C++ STL guidance.
Explore arrays and vectors as dynamic, contiguous data structures in c++, with doubling growth, o(1) access, and passing by value versus by reference.
Learn to submit coding exercises on Udemy, implement the given fizzbuzz function inside the template, and see how your solution is judged against tests.
implement the pair sum problem using an unordered set and a vector to return the matching pairs; check the complement before inserting the current element to avoid duplicates.
Sort the array, then use a two-pointer approach to find triplets that sum to the target, collecting and printing all valid triples.
Implement the highest mountain function by identifying peaks and counting contiguous elements to the left and right, updating the largest peak length while avoiding segmentation faults.
Implement the subarray sort solution by locating the smallest and largest out-of-order elements, then determine their left and right indices to sort the subarray.
Learn how to compute the minimum number of swaps to sort an array by building a value-to-position mapping, identifying disjoint cycles, and summing cycle lengths minus one.
Learn cycle-based solution to the minimum swaps problem: pair each element with its original index, sort by value, and count swaps as cycle length minus one using a visited array.
Compare character arrays and the string class in C++ and learn dynamic storage. Use getline for input, vector of strings for multiple inputs, and loop over each character.
Use the string class to search for a word inside a paragraph with the find function and obtain the first occurrence index, then locate subsequent occurrences.
Master space replacement by converting spaces to %20 using an in-place, right-to-left single-pass approach, counting spaces and shifting characters to accommodate extra space.
Execute an in-place space replacement by counting spaces, computing the final index, and performing a reverse pass to shift characters and insert %20, ensuring null termination.
Learn how tokenization splits a string by delimiters using a C++ stringstream and getline to extract tokens into a vector.
Strtok tokenizes a string by returning one token per call, starting at the input and using a static variable; call it first with the string, then null on subsequent calls.
Design a custom string tokeniser that scans left to right, uses a static state to track input, and builds tokens in a dynamic array until delimiters are reached.
We learn to sort strings by column keys formed from space-separated fields, using numeric or lexical comparisons, with an optional reverse and precomputed key pairs.
This lecture presents a string key sort implementation that reads lines, tokenizes input, builds a vector of string pairs, and sorts by numeric or lexicographic keys with optional reversal.
Learn to check whether the second string is a subsequence of the first using a two-pointer approach, achieving linear time O(m+n) instead of the exponential subset generation.
Explore bit manipulation with bitwise operators like and, or, xor, and not, and learn how binary representations and two's complement enable fast operations such as 5, 7, and 8.
Explore binary left shift, which multiplies a number by 2^B, and right shift, which divides by 2^B, with concrete examples from five and ten.
Learn to check odd or even using a bitwise operator. Use the last bit (x and 1) to determine parity, with an example showing odd and even results.
Get the i-th bit of a number using bitwise operations. Create a mask by left shifting 1 i times and use it with the number to yield 1 or 0.
Learn to clear the i-th bit by creating a mask with 1 << i, negating it, and using bitwise AND to zero only that bit in a number.
Clear the last i bits of a number by left-shifting minus one to form a mask and applying a bitwise and with the original number.
Learn to replace bits between indices i and j in a 32-bit number with bits from m by clearing the range, creating a mask, left-shifting m, and or-ing with n.
Learn to determine if a number is a power of two using a bitwise and with n minus one, a fast order one check.
Count set bits in a number using bitwise operations, tracking the last bit with n & 1 and removing it by right shifting, with a loop running in O(log n).
Convert a decimal number to binary using repeated division by two, capturing remainders and assembling the binary digits via powers of two.
Explore the housing problem by finding all continuous subarrays whose sum equals k using a sliding window two-pointer approach, achieving linear time and constant space.
Explore the window approach to find subarrays summing to k by expanding and contracting the window, tracking the current sum, and printing the i to j-1 window.
Explore the unique substring problem by applying a sliding window approach with two pointers and a hash map to track last occurrences, expanding or restarting windows to maximize length.
Implement the unique substring problem using a sliding window and hash map to track last occurrences, update start and max length, and return the corresponding substring.
Discover how to find the smallest window in a big string that contains all characters (including duplicates) of a small string, using a sliding window with frequency maps.
Learn a sliding window algorithm that uses frequency maps for the pattern and string, expands and contracts the window, and returns the smallest valid substring.
learn how merge sort uses divide and conquer to recursively sort an unsorted array's left and right subarrays. then merge them with two pointers into a single sorted array.
Learn to implement merge sort with a recursive approach that splits at the midpoint into left and right parts, merges with a temporary vector, and copies back.
Explore the inversion count problem on arrays, moving from brute force to a divide-and-conquer merge-sort approach that counts left, right, and cross inversions for an O(n log n) solution.
Learn quicksort, a divide-and-conquer sorting algorithm that uses a pivot to partition an array into elements less than and greater than the pivot, then recursively sorts each part.
Implement the quicksort algorithm by writing the partition function and the recursive quicksort calls. Manage base cases and pivot placement for left and right partitions.
Implement the smallest string traversing problem by sorting strings with a custom comparator that compares x+y and y+x, then concatenate the sorted array to produce the output like aabaab.
Explore the sparse search problem on a sorted array with empty strings, and learn a modified binary search that uses nearest non-empty strings to efficiently locate a key.
Learn to count frequency of a target in a sorted array using binary search by finding the first and last occurrences and computing frequency as last minus first plus one.
Learn to count frequency efficiently in C++ by using lower_bound and upper_bound from the standard template library; compute frequency as upper_bound minus lower_bound in one line of code.
Discover how to search a rotated sorted array with a modified binary search, using pivot-based halves and conditional decisions to locate an element's index efficiently.
Explore the rotated search implementation using a modified binary search, splitting the array around the pivot and narrowing the search by comparing against the left and right sorted parts.
Implement the square root using binary search from 0 to n, then refine with a linear search for decimals to achieve the floating-point result.
Sort nest positions, apply a binary search on the minimum separation, and use a canPlace feasibility check to maximize the distance between birds in nests.
Learn to find a pair with minimum absolute difference between two arrays using sorting and lower bound, yielding an efficient O(m log m + n log m) approach.
Sort one array, then for each element in the first array find the closest element in the second array using lower_bound, evaluating left and right neighbors to minimize the difference.
Recap recursion by showing how to break a problem into its smallest case. Define base and recursive cases, and follow a depth-first, left-to-right call tree managed by a stack.
Learn to count ways with a recursive approach: base case n equals 0 returns 1, recursive calls n-1 and n-2, and negative n returns 0; dynamic programming handles overlapping subproblems.
Explore how to generate all subsequences of a given string using a recursive brute-force approach, by including or excluding each character and forming subsets.
Count subsets that sum to x in an array using a recursive include/exclude approach, with base cases, and hint at dynamic programming for optimization.
Build a recursive print keypad output function that converts a numeric string into all possible letter combinations using keypad mappings, skipping 0 and 1, and printing results.
Explore the n-queen problem and backtracking approach to place one queen per row on an n by n board so that no queens attack each other, printing a valid configuration.
Implement an n-queen solver with backtracking. Build a board, place one queen per row, use can_place to check column and diagonals, print on success, and backtrack otherwise.
Explore the n queen problem with a backtracking solution that builds a board, places queens row by row, checks the column and diagonals, backtracks when needed, and prints valid configurations.
Explore solving Sudoku on a 9x9 grid by backtracking and recursion, filling empty cells (zeros) with valid digits 1-9 while enforcing row, column, and subgrid constraints.
Explore reversing a linked list with recursive and iterative approaches. Learn how to flip pointers, update head and tail, and handle base cases and null termination.
Implement a recursive reverse of a linked list by handling base cases for null or single-node lists, then recursively reverse the rest and reconnect the nodes.
Explore reversing a linked list using an iterative approach. Track current, previous, and temp nodes to safely update links and return the new head.
merge two sorted linked lists by adjusting pointers without creating new nodes, compare a.data and b.data with a two-pointer approach and recursion, handling null end cases to return merged list.
Learn the runner technique in linked lists by using two pointers, fast and slow, to find the midpoint efficiently and apply this logic to other problems.
Implement merge sort on a linked list by handling zero or one node, splitting at the midpoint with slow and fast pointers, and merging the sorted halves.
Review stacks, queues, and deques, detailing their LIFO and FIFO behavior, push and pop operations, and how they enable BFS, level-order traversal, and iterative solutions for recursion.
Identify redundant parentheses in a balanced expression by using a stack to track operands and operators; if no operator exists inside brackets, mark them as redundant.
Implement a streaming solution to find the first non-repeating character using a queue and a frequency map, reading input until a dot and outputting the result or -1.
Build a function to simplify a file path by normalizing absolute and relative paths, collapsing multiple slashes and dot-dot segments, and preserving root constraints to produce an equivalent path.
Do you find yourself feeling like you get "stuck" every time you get a coding question?
Welcome to Data Structures & Algorithms, Level up Course the only course that provides you an ultimate practice on problem solving process and helping you to take your data structures & algorithms to the next level. The course is taught by an expert instructor Prateek Narang from Google, who is not just a software engineer but also has mentored thousands of students in becoming great programmers & developers.
The Course contains 25+ hours of interactive video content & dozens of coding exercises, teaching you the right tips & tricks in problem solving in a most concise way. Every problem discussion starts with a brute force approach, optimisations and ends with hands-on-coding video in C++ as well.
Here is what you will learn -
Problems on Data Structures
* Arrays, Strings, Vectors
* Hashing (Unordered Maps, Maps, Sets)
* Stacks, Queues, Linked Lists
* Binary Trees, BSTs, Heaps
* Graphs, Tries
Problems on Algorithms
* Brute force, Backtracking
* Sliding Window Algorithms
* Sorting, Searching, Binary Search
* Dynamic Programming Fundamentals
* Important Graph Algorithms
* BFS & DFS, Shortest Paths
Course exercises are in C++ but programmers having experience in one or more languages (C++/Java/Python/JavaScript) can definitely do this course, provided they have fundamental understanding of data structures. The course covers both breadth & depth of topics, diving deep where-ever needed. You will also learn how to apply techniques involving like - sorting & searching algorithms, sliding window, binary search, hashing which are very important for problem solving. For advanced topics like Dynamic Programming & Graphs, the course starts from the basics & helps you master these topics from the very fundamentals.
Unlike most instructors, I am not a salesperson or a marketer. My job is to help you build strong fundamentals in programming & be a successful developer. Through Udemy, I am providing this course to you at a fraction of cost of its original cost, so that anyone who is interested to learn can take their skills to the next level. So I hope you sign up today, and I will see you in the course.