
Learn algorithm design techniques in JavaScript through live coding, covering complexity analysis, recursion, backtracking, divide and conquer, greedy methods, and dynamic programming.
Learn how algorithms, as step-by-step instructions, let computers solve problems with data correctly and efficiently. See how a recipe-like process has a definite start and end, and supports multiple solutions.
Explore complexity analysis by examining how time and space complexity measure an algorithm's performance. Describe input size, worst-case behavior, and big O notation to capture asymptotic growth.
Discover complexity analysis by exploring how algorithms scale with input size through constant, logarithmic, linear, quadratic, cubic, and exponential, using big o notation and lower-order term elimination to compare performance.
Analyze the complexity of algorithms by focusing on cpu usage, ignoring compiler optimizations, and review big o notation for constant, logarithmic, linear, quadratic, exponential, and factorial complexities.
Explore recurrence relation in algorithms with a clear, beginner-friendly approach. Learn what recurrence relations are, why they matter, and how to solve them, including the masters theorem.
Explore recurrence relations that relate a_n to its predecessors, illustrated by factorial and fibonacci examples, and learn initial conditions and base cases that enable recursion.
Solve recurrence relations to derive time complexity in big o notation by the substitution method, applying to factorial and fibonacci computations, identifying base cases and bounds.
Master theorem solves recurrences t(n) = a t(n/b) + f(n) with a ≥ 1 and b > 1, giving t(n) = n^{log_b a}.
Review recurrence relations, their importance, and where to apply them. Learn how to solve these relations and apply the master theorem.
Explore recursion as the foundation of algorithm design, examining memory behavior, types, recurrence relations, and how to identify problems solvable by recursion, with live coding and practice.
Explore algorithms as step-by-step instructions that solve problems by processing data, with examples from simple calculations to large systems, emphasizing correctness and efficiency in time and space.
Identify whether a problem can be solved by recursion by ensuring it breaks into smaller identical subproblems with a base case, using sums, arrays, strings, and binary trees as examples.
Learn to approach recursive problems by defining the function, solving a subproblem, using its result to build the sum from 1 to n, and identifying the base condition.
Discover how to find all subsequences of a string using a recursive get subsequences function, detach the first letter, recurse on the remainder, and include the empty string.
Implement a recursive getSubsequence(word) in JavaScript to generate all subsequences: take the first character and recurse on the rest, combining with commas. Test with abc.
Examine the complexity of generating subsequences with recursion, showing exponential time of about 2^n and linear space due to recursion depth, as each added character doubles subsequences.
Solve the tower of hanoi puzzle with recursion, using a three-rod setup and a recursive function to print moves, handle base cases, and shift discs via from_rod, to_rod, and aux_rod.
Explore the Tower of Hanoi algorithm in JavaScript through recursive steps, moving n disks from from-rod to to-rod, using aux-rod, with base cases and detailed execution flow.
Analyze the tower of Hanoi time complexity, showing exponential growth 2^n from two recursive calls and the recurrence tn=2 tn-1+1, with space complexity n due to stack depth.
Learn to compute the product sum of a nested array by recursively summing elements and multiplying by their depth, using a depth-aware helper function and a clear base case.
This lecture demonstrates implementing a recursive function to compute the product sum of a nested array, adding non‑array elements and recursing into subarrays with increasing depth, then multiplying by depth.
Understand the algorithm's time complexity as linear, visiting each element once, and the space complexity as the stack depth equal to the array depth of three.
Use recursion to determine if one binary tree is a subtree of another by comparing in-order and pre-order traversals.
Construct two binary trees with a node class, perform in-order and pre-order traversals, and determine if one tree is a subtree by comparing traversal strings.
Analyze time and space complexity for subtree detection by computing in-order and pre-order traversals for both trees, with operations and storage scaling as N+M.
Explore recursion versus iteration, noting that iterative versions are faster due to expensive function calls and stack memory. Tail call optimization appears in some languages.
Explore tail recursion and tail call optimization, where an accumulator enables the compiler to optimize calls into iteration, reducing stack frames and preventing overflow, with examples like Scala and Kotlin.
Recap recursion basics, memory behavior, and the faith that recursion will complete steps, then cover types, relations, problem identification, and classical problems with tail call optimization.
Explore backtracking as an extended recursion technique for problems that require undoing decisions in real time, with applications in strategy game programming.
Explore backtracking as a recursive problem-solving technique that makes sequential choices, abandons failed paths, and tries alternatives until reaching a solution, with future lessons on identification and approach.
Identify backtracking problems by spotting a set of choices and constraints, and use candidates and backtracking to try alternatives when a dead end occurs, as in sudoku.
Identify the four core elements of backtracking: choices, constraints, recursion, and goal, then apply them to a matrix maze to reach the bottom-right cell.
Solve the rat in a maze using backtracking: navigate from the top-left to the bottom-right through ones, avoid zeros, apply recursion with constraints, and backtrack to undo false paths.
Explore solving the rat in a maze with backtracking by implementing a solve maze function, using safe checks, a solution matrix, and a base case to trace a path.
Analyze the rat in maze complexity with two recursive calls per step; on an n by n grid it becomes 2^(n^2), otherwise 2^(n*m), and the output matrix requires space o(n^2).
Solve the n-queens problem on an n by n board by backtracking, placing n non-attacking queens with horizontal and diagonal checks, exploring column by column or row by row.
Implement a backtracking n-queens solver in JavaScript by placing queens on a 2d board, using isSafe to check horizontal and diagonal attacks, and backtracking recursion to find a solution.
backtracking analyzes the n queens problem, showing a factorial time complexity due to exploring placements, with linear space on the call stack since the board is provided.
Explore the knight's tour problem on an n by n chessboard, using backtracking and recursion to visit every cell exactly once, validating eight possible knight moves and backtracking when needed.
Develop a knight tour on an 8x8 board using path arrays for moves, validating and backtracking to fill cells with step counts from 0 to 63 in JavaScript.
Analyze knight tour problem complexity with a worst-case runtime of 8^(n^2) and a space complexity of n^2 due to recursive calls.
Explore solving the boggle word search with backtracking on a character matrix, moving to eight neighbors, avoiding revisited cells, and checking formed words against a dictionary.
Explore a live JavaScript implementation of Boggle word search, using a 4x4 board, a visited matrix, and recursive backtracking to build dictionary words from adjacent letters.
Analyze the complexity of the word search (boggle) problem by counting eight moves per cell, deriving time complexity 8^(m×n) and space complexity O(m×n) from recursion.
Explore backtracking, an extended form of recursion, a design technique that allows runtime decision changes and stepping back to solve problems, especially in game programming.
Learn the divide and conquer design technique to solve problems optimally by identifying approaches and solving classical problems with hands-on coding along, building confidence.
Explore the divide and conquer technique by splitting problems into subproblems, solving them, and combining results, with binary search time of O(log n) and mapreduce for big data.
Identify problems suitable for divide and conquer by ensuring they split into two or more subproblems of the same kind solved recursively and combined for a global result.
Explore how merge sort divides an array into halves using bounds and a mid index, recurses to single elements, and merges subarrays into ascending order with i, j, and k.
Explore a live JavaScript merge sort implementation using lower and upper bounds, a Math.floor midpoint, and recursive division; merge sorts with left and right subarrays.
Analyze merge sort complexity by dividing halves to base case in log n steps, merging at each level in n time, yielding O(n log n) time and O(n) space.
Master quick sort by selecting a pivot and partitioning the unsorted array into smaller and greater subarrays, then recursively sort each partition until the whole array is sorted.
Learn how quicksort uses a partition step with a pivot and left and right pointers. The algorithm swaps elements and recurses on subarrays defined by lower bound and upper bound.
Apply the median of medians algorithm to find the array median in linear time by selecting a pivot from five-element subarray medians and partitioning until the middle index is reached.
Apply the median of medians algorithm to select the kth element by chunking the list into five-element groups, computing medians, and recursively using the median of medians as pivot.
Explore divide and conquer techniques in algorithms with practical problem solving, learning to identify, approach, and solve divide and conquer challenges to reinforce understanding.
Explore greedy algorithms in the JavaScript design techniques course by learning to identify problems solvable by greedy, compare local best and global solutions, and apply greedy approaches.
Explore the greedy technique, which makes locally optimal choices at each step in the hope of a globally optimal solution, with coin change and ATM examples.
Identify problems solvable by greedy by recognizing independent subproblem sets, then choose the next best local option to build a global solution, with fractional knapsack as an example.
Learn to solve the fractional knapsack problem with greedy selection of items by value per weight, and contrast it with zero-one knapsack solved by dynamic programming.
Master the fractional knapsack using a greedy JavaScript approach by building and sorting items by cost (value/weight) to maximize profit, including fractional fills when needed.
Analyze the complexity of fractional knapsack by sorting items by value-to-weight ratio, with the dominant time of n log n and constant space complexity.
Apply a greedy approach to interval scheduling maximization by sorting by finish times and selecting non-overlapping intervals to maximize the count.
Sort the intervals by end time, then select non-overlapping intervals whose start times exceed the last finish time to maximize the number of intervals. Return the optimal interval set.
Sort intervals by end times and scan to identify non-overlapping intervals. Time complexity is order of n log n, with space order n for output array, or constant if excluded.
Explore Huffman coding, a greedy data compression technique that assigns shorter codes to frequent characters and builds a binary tree from character frequencies to enable efficient decoding.
Explore how to implement Huffman code in JavaScript to encode a string by building a frequency map, constructing a Huffman tree, and generating binary codes for each character.
Analyze Huffman coding complexity: store frequencies in a map, build the tree via a priority queue, and assign binary codes; time complexity is n log k, space complexity is k.
Apply Dijkstra's algorithm to find the shortest paths from a source node in a weighted graph, using a distance table, matrix of edge weights, and a visited set.
Applies Dijkstra on an adjacency matrix, initializes visited and distance arrays from vertex 0, repeatedly selects the min-distance vertex, relaxes edges, and prints final distances.
Determine time complexity by iterating vertices to find shortest paths and adjacent vertex with minimum distance from source, yielding worst-case n^2 time and arrays of size n for space complexity.
Introduce the greedy algorithm as a problem-solving technique. Learn to identify problems that fit greedy and practice with handpicked examples to tackle real-world challenges.
Explore how dynamic programming saves computation by remembering past results to avoid recomputation. Compare top-down and bottom-up approaches for solving classic problems in JavaScript.
Store subproblem results in memory to optimize recursive solutions from dynamic programming. Illustrate with the Fibonacci sequence showing overlapping subproblems and how memory prevents redundant calculations.
Identify whether a problem fits dynamic programming by checking if it can be broken into smaller, overlapping subproblems and aims for an optimal solution, such as shortest or maximized outcomes.
Compare dynamic programming, divide and conquer, and greedy approaches, highlighting recursion, overlapping subproblems, optimality guarantees, and when greedy may fail as in coin change.
Learn dynamic programming approaches, including top-down recursion with memoization and bottom-up iteration, to store subproblem results, handle base cases, and build solutions from previous values.
Master the staircase problem with dynamic programming, using 1-2-3 (and other k) steps; build recursive, memoized top-down solutions, and implement bottom-up DP to count ways to reach n stairs.
Analyze the staircase problem's complexity, showing recursive time complexity 3^n and space complexity n, and compare top-down and bottom-up approaches using an array of size n.
Discover how 0/1 knapsack differs from fractional knapsack, why greedy fails, and how to solve it with dynamic programming using top-down memoization and bottom-up approaches.
Analyze the 0/1 knapsack complexities for recursive, top-down, and bottom-up approaches: exponential time for the naive recursive solution, and n×w time and space with an n×w matrix.
Solve the coin change problem with infinite denominations and a target amount by exploring recursive subproblems, using top-down memoization and bottom-up dynamic programming to minimize coins.
analyze the coin change problem across recursive, top-down, and bottom-up methods, showing how m (coins) and a (target) drive time complexity m^a or m·a and space complexity O(a).
Explore the complexity analysis of the longest decreasing subsequence algorithms in javascript, comparing recursion, top-down memoization, and bottom-up methods with exponential, O(n^2), and O(n) space profiles.
Solve Levenshtein distance, a dynamic programming problem, between two strings using insert, delete, and replace operations; explore top-down memoization and bottom-up 2d array approaches to compute the edit distance.
Analyze Levenshtein distance complexity across recursion, top-down with memoization, and bottom-up dynamic programming, comparing exponential and linear space in m by n, and highlight optimization using three adjacent cells.
Explore the rod cutting problem and learn dynamic programming to maximize revenue by evaluating all cuts. Implement top down memoization and bottom up solutions to optimize subproblems and avoid recomputation.
Analyze the complexities of rod cutting, showing recursion with exponential time 2^(n-1) and stack space, and top-down and bottom-up approaches with O(n^2) time and O(n) space.
Explore how to solve matrix chain multiplication with dynamic programming to minimize operations, using top-down memoization and bottom-up approaches.
Analyze matrix chain multiplication complexity in JavaScript through recursive, top-down memoized, and bottom-up approaches; reveal exponential time 2^n in naive recursion and O(n^3) time with O(n^2) space in optimized versions.
Learn dynamic programming concepts, identify problems, and apply top-down and bottom-up approaches, comparing with other techniques and solving practice problems to prepare for your next coding assignment.
Explore Kadane's algorithm for the maximum contiguous subarray sum, deriving a linear-time dynamic programming solution that tracks the maximum sum ending at each index to find the global optimum.
learn how Kadane's algorithm computes the maximum subarray sum in JavaScript by maintaining local max and global max through a single pass and applying it to a sample list.
Analyze Kadane's algorithm complexity: time is O(n), a linear time due to a single for loop scanning the array once. Keep space complexity constant, as it uses no data structures.
apply bellman ford algorithm to compute the single-source shortest path in weighted graphs with negative weights, using dynamic programming and relaxation for n minus 1 iterations, noting negative cycles.
Construct a graph with six vertices and nine edges, implement the Bellman-Ford shortest distance from a source, and detect negative cycles by edge relaxation and distance updates.
Analyze the bellman-ford algorithm's time complexity as O(VE), iterating over each edge for V-1 iterations. Assess the space usage as O(V) when the implementation only stores a distance array.
Use Kahn's algorithm to perform a topological sort on a directed acyclic graph by removing zero in-degree vertices and updating in-degrees.
implement a directed graph with an adjacency list in javascript, compute in-degrees, and perform a topological sort with a queue to produce a linear order while detecting negative cycles.
Analyze kahn's algorithm complexity for topological sort, showing time complexity O(v+e) by traversing the adjacency lists and in-degrees, and space complexity O(v) for the queue.
Learn how to solve max-flow problems from a source to a sink using the Ford-Fulkerson method, guided by residual graphs, bottleneck capacities, and augmenting paths.
Implement Ford-Fulkerson using breadth first search (Edmon's karp) to compute the maximum flow. Build a residual graph, find augmenting paths, update capacities, and track bottleneck flow from source to sink.
Algorithm Design Techniques : Live problem solving in Java Script
Algorithms are everywhere! One great algorithm applied sensibly can result into a System like GOOGLE!
Larry Page, founder of google designed “Page Rank” algorithm that is behind the search in google. That is why when we search on google we generally find the most relevant result on the First Page itself.
Every Computer Programmer should learn how to design algorithms which are not only correct but also efficient in terms of
TIME and SPACE!
Completer scientists have worked from 100s of years !! - (Put images of some of the scientists…)
And derived some of the techniques that can be applied to write and design algorithms!
So Why to reinvent the wheel ??
Let’s go through some of the most famous algorithm design techniques in this course!!
Once you will come to know these design techniques It will become very easy for you to approach a problem by identifying which technique to apply to solve that correctly and efficiently.
We will start this course with some measurement techniques in algorithms that is called complexity analysis so that we can measure -
The time and space in an algorithm when we design that.
Then we will start with understanding recursion and deep dive into that.
Recursion is the base of any algorithm design … because most of the algorithms has to be solved using recursion!
Recursion is executed in computers in a very special way using stack frames… we will understand all that..
There are many types of recursion and we will have a look into that.
We will solve some classic problems like the Tower of Hanoi, Binary subtree… to understand the recursion deeply…
And WE WILL WRITE THE CODE LINE BY LINE IN JAVA !! To make it very easy to understand and code…
Then we will move into another design technique backtracking !!
Backtracking algorithms are enhanced recursion where we can revert our decision from inside a recursion…
We will understand how to Identify and approach this kind of problems..
Also, we will solve some classical problems
Rat In Maze, NQueens, KnightsTour problems… and Code them LINE by LINE …
Then, We will then move to the next section
Divide and Conquer… Greedy algorithms
And will take the same approach !! To understand identify and Solve some problems… and code some classic problems.
Then there will be a very important section! Dynamic programming
That is not only important for Algorithms design but also, Interviews
This is a very favorite paradigm for the interviewer to ask questions from - We will solve a lot of problems in section along with code… and understand how to approach this kind of problem!!
All in all!
By the end of this course -
1. You will understand how to design algorithms
2. A lot of coding practice and design live problems in Java
3. Algorithm Complexity analysis
AND
If you are preparing for your coding Interview or doing competitive programming
This course will be a Big help for you!
I think this is enough to create the THRILL !! I welcome you to the course and I am sure this will be fun!!
If it does not - It comes with a 30 Days money-back guarantee so don’t think twice to give it a shot…
Welcome Again !! And See you in the course.