
Learn a structured LeetCode approach: read problems, understand samples, think brute-force patterns, then optimize with guided code walkthroughs and language-specific files.
Explore time and space complexity analysis, measuring runtime by counting operations and expressing growth with Big-O notation, and analyzing memory use for algorithms with respect to input size.
Explore the language of time and space complexity through big O notation. Compare linear, constant, quadratic, and logarithmic complexities, and relate runtime and memory usage to input size.
Learn to assess if an algorithm's time complexity is acceptable during interviews by estimating operations and using constraints to predict backtracking for small inputs and binary search for large.
Analyze time capacity of loops in JavaScript by counting operations per iteration and loop counts, deriving big-O notes like O(n) for a linear loop and O(1) for a constant-time loop.
Explore time complexity in loops with a doubling while loop and nested loops, deriving O(log n) and O(mn) by counting operations and applying base-2 logarithms.
Learn how space complexity measures memory growth with input size, accounting for variables, external data structures, and recursion, and how to sum these contributions.
Analyze space complexity in a simple for loop example, counting only variables while excluding input arrays and data structures. Conclude that the algorithm uses constant space, O(1).
Explore how arrays are implemented as a contiguous memory range, storing homogeneous elements and enabling constant-time access through address plus index times element size, while noting the drawbacks of contiguity.
Reveal the static size drawback of arrays: beginning or middle insertions and deletions require shifting, causing inefficiency; linked lists or vector or array lists offer dynamic alternatives.
Learn how resizable arrays work by using ArrayList and Vector to overcome static size, doubling capacity when full, copying elements, and achieving amortized O(1) insertions.
In this lecture, you implement a resizable array in JavaScript as a wrapper over the native array, with an initial capacity of two, doubling, and push and get methods.
Analyze the amortized time complexity of inserts in a resizable array, showing bursts of copying during resizing and concluding that amortized cost is O(n), with practical language recommendations.
Master max consecutive ones in a binary array by scanning once, counting ones, updating the maximum, and resetting on zeros, a binary form of the maximum sum subarray problem.
Learn to compute the best time to buy and sell a stock in one transaction by tracking the minimum price before each day to maximize profit without shorting, using JavaScript.
Learn to compute the product of an array except the current index in O(n) time without division by building left and right product arrays, with a JavaScript implementation.
Practice problem 5 explores the maximum product subarray by tracking max and min products at each index to handle negatives and zeros, using left-to-right and right-to-left passes.
Master the set matrix zeros problem by implementing an in-place, constant-space solution in JavaScript that marks rows and columns using the first row and column, with boolean flags.
Validate a sudoku by checking rows, columns, and 3x3 grids, considering only filled cells; use an array of sets to detect any repetition efficiently.
Rotate an array to the right by k steps using k mod n. Apply three reversals: whole array, first k elements, then the rest, in O(n) time and O(1) space.
Practice problem 1, trapping rain water, uses an elevation map to show water trapped between bars. Apply the two-pointer approach with left and right max heights to compute total water.
Master the two-pointer approach to find two numbers that sum to a target in a sorted, non-decreasing array, returning one-indexed positions.
Use a two-pointer approach on the height array to maximize water contained between two lines, computing area as width times the minimum height and moving the smaller height pointer.
Learn to solve the valid palindrome problem using a two-pointer approach, normalizing to lowercase and filtering out non-alphanumeric characters. Practice implementing alphanumeric checks and end-to-end string comparisons in JavaScript.
Learn the fundamentals of sorting, from numbers and strings to custom objects, and explore practical algorithms like merge sort, quicksort, heapsort, and radix sort, with emphasis on ascending order.
Bubble sort compares consecutive elements and swaps when out of order to sort an array in ascending order. The largest element bubbles to the end, expanding the sorted portion.
Implement a bubble sort that iterates over an array, swaps adjacent out-of-order elements, and moves the largest element to the end, then export and test the sorted array.
Explore the selection sort algorithm, repeatedly selecting the smallest element from the unsorted portion and swapping it into the front, so the sorted part grows until the array is sorted.
Explore the selection sort implementation that finds the smallest element in the remaining array and swaps it into place, detailing the inner loop and swap operation.
Understand insertion sort, which builds a sorted prefix by inserting unsorted elements into their correct positions, shifting larger elements, and is faster on sorted data than bubble or selection sort.
Master the merge operation on two sorted arrays using two pointers to form a sorted array C, and understand its linear time complexity O(n+m) for merge sort.
Learn to merge two sorted arrays using a two-pointer approach, building a new sorted result by comparing elements, copying the smaller value, and appending remaining items.
Apply divide and conquer to merge sort by dividing the array into two parts, sorting each part, and merging the results into a fully sorted array.
Implement a recursive merge sort in JavaScript using a master helper and a separate merge function to combine sorted halves, with start and end indices and integer mid calculations.
Discuss the time complexity of merge sort as O(n log n) and its space complexity as O(n), highlighting the divide and conquer steps and the merge phase.
Apply the partition function to quicksort by using a pivot, partitioning the array into less than, equal to, and greater than key, and update left to move elements accordingly.
Implement a two-way partitioning algorithm using the last element as pivot, moving smaller values to the left and larger values to the right, not sorting, for quicksort.
Quicksort theory is explained through partitioning, which places the pivot in its correct position. The algorithm then recursively sorts the subarrays on each side, unlike merge sort.
Learn to implement quicksort in JavaScript using a partition with a pivot, then recursively sort left and right subarrays via a wrapper function.
Explore counting sort, a non-comparison based sorting method that counts frequencies, builds a cumulative count, and yields a stable, linear-time ordering.
Implement counting sort in JavaScript by finding the max value, building a count array and a cumulative summary, then placing elements from right to left into a result array.
Sort colors in place by applying the Dutch national flag algorithm with left and right pointers, swapping zeros to the left and twos to the right, without extra space.
Explore the majority element problem in arrays, where an element appears more than n/2 times, and solve it in linear time with O(1) space using the Morse voting algorithm.
Move zeros to the end by compacting non-zero elements to the left, preserving their order, using a start index and swaps to implement a two-pointer solution.
Explore the drawbacks of arrays, including their contiguous memory and the costly shifting required for middle insertions and deletions. Learn how linked lists address these efficiency issues.
Explore why arrays are contiguous and why linked lists use nodes with data and references; learn traversal from head, while insertions and deletions in the middle avoid shifting.
Implement a linked list in JavaScript by creating a node class with data and a next pointer. Manage it with a head and add elements front, middle, end, and size.
Insert at the front of a linked list by creating a new node, linking it to the current head, and updating head, handling both empty and non-empty lists.
Implement insert at the front for a linked list by creating a new node with the given data, updating the head, and linking the old head.
Learn to iterate over a linked list by using a current pointer starting at head, printing the data of each node, and advancing with current = current.next until null.
Implement a linked list iterate function that traverses nodes, logs data, and supports a callback; test by inserting at front to produce 30, 20, 10 and 40, 30, 20, 10.
Detect a cycle in a linked list using the hare and tortoise algorithm, employing slow and fast pointers to distinguish a cycle from null termination.
Merge two sorted linked lists into a single sorted list by splicing nodes, using a two-pointer method, and return the head of the merged list in JavaScript.
Learn to reverse a singly linked list from its head and return the new head. Explore a recursive approach using next and last pointers to reverse from a node onward.
construct an in-place palindrome check for a singly linked list by reversing the second half and comparing halves using two pointers, achieving o(n) time and o(1) space.
Explore the intersection of two linked lists by identifying the exact intersection node using a space-optimized two-pointer approach that aligns list lengths and avoids extra memory.
Explore hash tables, also known as hash maps or dictionaries, and learn how to store key–value pairs, perform get and put operations, and compare with arrays for fast lookups.
Explore how a hash table uses a pure, stateless hash function to map keys to array indices via modulo, enabling put and get operations and highlighting collision challenges.
Explore how collisions occur in hash tables and how chaining with linked lists resolves them. Learn hash values, mod operations, index placement, and worst-case and amortized O(1) performance.
Determine whether two strings are valid anagrams by using a hash table to track frequencies or by sorting, splitting, and joining in JavaScript.
Solve the longest consecutive sequence problem in an unsorted array by using a set for constant-time lookups, starting sequences only when the previous number is absent, with a JavaScript implementation.
Detect duplicates in an array of integers using a hash table in JavaScript; return true when a value appears at least twice, otherwise return false.
Group strings into anagrams using a hash table; sort each string to form a key, accumulate matching strings in lists, and return the final array of grouped anagrams.
Explore the stack as a last-in, first-out abstract data type, learn its core operations push, pop, and top, and compare array and linked-list implementations.
Discover how to implement a stack in JavaScript using an array, with push and pop at the end and retrieving the top element from the last array item.
Learn to implement a stack using a linked list in JavaScript, performing push, pop, and top in O(1) time by inserting at the head.
Implement a stack using a linked list by reusing the linked list class, maintaining size, and exposing push, pop, and top methods that access the head as the top element.
Solve the valid parenthesis problem by using a stack to check balance of round, curly, and square brackets, ensuring same type, correct order, and every close has an open.
Implement a min stack with push, pop, top, and get min in O(1) by using two stacks: a main stack and an auxiliary min stack.
This lecture covers the next greater element II problem on a circular array, using a stack for delayed processing to find each element’s next greater, with wrap-around and -1.
Explore how queues function as an abstract data type with fifo ordering, inserting at the back and removing from the front, and how deques add end-to-end flexibility.
Learn how to implement a queue with a linked list by maintaining head and tail pointers, inserting at the end and removing from the front for constant-time operations.
implement a queue in JavaScript using a linked list with head, tail, and size; add appends to the end, and remove takes from the front, with peek and isEmpty utility.
Define the search space in binary search, select a midpoint, and compare keys to locate targets in sorted arrays, then shrink the range by half to achieve O(log n) time.
Implement an iterative binary search on a sorted array to locate a key, using start, end, and midpoint with floor, and return the found index with log n time.
Explore the time complexity of binary search, showing how the search space halves each iteration and yields O(log n) time, with best and worst case contrasts.
Solve the search insert position problem in a rotated sorted array using binary search, locate the rotation point, and search the correct half for the target or insertion.
Apply binary search to find the minimum eating speed, between 1 and max pile size, that finishes all banana piles within eight hours, using isPossible to sum ceil(pile/speed) hours.
maximize the minimum magnetic force by placing m balls into sorted basket positions using binary search, with an isDistancePossible helper to verify feasible distances in JavaScript.
This course is designed to help you master DSA and ace coding interviews in Javascript.
Jump into the world of Javascript Data Structures & Algorithms with us, starting from the very basics to advanced
What sets this course apart?
We put a lot of emphasis on solving problems and making concepts easy to understand. Forget complex jargon – we focus on practical problem solving techniques you will use.
And here's exciting news..
We've curated 100+ Leetcode Practice Problems to accompany the theory lectures.
Still wondering why should you choose this course?
You’ll love our two-step approach: we start with the theoretical concepts of each data structure and technique, and then provide abundant practice problems to hone your skills and cultivate a problem-solving mindset.
Expect regular updates with over 120 lectures distributed across 12+ sections to ensure you stay abreast of industry trends and the latest interview questions.
Explore various data structures comprehensively, including Arrays, Linked Lists, Stacks, Queues, Hash Tables, Deques, Binary Search Trees, Trees, Heaps, Graphs, and Disjoint Set Data Structures.
Delve into algorithms and problem-solving techniques such as Binary Search, Binary Search over a range, Binary Search over a partially sorted range, Sliding Window Method, Two-Pointer Method, Greedy Algorithms, Dynamic Programming, Backtracking, and Bit Manipulation.