Log In
Join
for free
Log In
Join
for free
Back To Course Home
Algorithms for Coding Interviews in Java
0% completed
Introduction
Intended Audience
Learning Outcomes
Algorithmic Paradigms
Brute Force
Greedy Algorithms
Divide and Conquer
Dynamic Programming
Asymptotic Analysis
Comparing Algorithms
Example: Measuring Time Complexity of a Single Loop Algorithm
Example: Time Complexity of an Algorithm With Nested Loops
Introduction to Asymptotic Analysis and Big (O)
Other Common Asymptotic Notations and Why Big (O) Trumps Them
Useful Formulae
Common Complexity Scenarios
Challenge: Big (O) of Nested Loop with Addition
Solution: Big (O) of a Nested Loop with Addition
Challenge: Big (O) of Nested Loop with Subtraction
Solution: Big (O) of a Nested Loop with Subtraction
Challenge: Big (O) of Nested Loop with Multiplication
Solution: Big (O) of Nested Loop with Multiplication
Challenge: Nested Loop with Multiplication (Basic)
Solution: Nested Loop with Multiplication (Basic)
Challenge: Nested Loop with Multiplication (Intermediate)
Solution: Nested Loop with Multiplication (Intermediate)
Challenge: Nested Loop with Multiplication (Advanced)
Solution: Nested Loop with Multiplication (Advanced)
Challenge: Nested Loop with Multiplication (Pro)
Solution: Nested Loop with Multiplication (Pro)
Complexity Interview Questions
Sorting and Searching
Selection Sort, Bubble Sort, and Insertion Sort
Merge Sort
Quicksort
Time Complexities of Sorting Algorithms (Overview)
Searching Algorithms
Challenge: Find Two Numbers that Add up to "n"
Solution: Find Two Numbers that Add up to "n"
Challenge: Search in a Rotated Array
Solution: Search in a Rotated Array
Challenge: Group Anagrams
Solution: Group Anagrams
Challenge: Find the Median of Two Sorted Arrays
Solution: Find the Median of Two Sorted Arrays
Challenge: Find Duplicates in Array
Solution: Find Duplicates in Array
Challenge: Search in Sorted Matrix
Solution: Search in Sorted Matrix
Challenge: Count Element Occurrence
Solution: Count Element Occurrence
Challenge: Search Insert Position
Solution: Search Insert Position
Challenge: Sparse Search
Solution: Sparse Search
Challenge: Dutch National Flag Problem
Solution: Dutch National Flag Problem
Quiz on Sorting & Searching
Dynamic Programming
Fibonacci Series Using Recursion
Introducing Dynamic Programming With Fibonacci Numbers
Memoizing Fibonacci Numbers
Tabulating Fibonacci Numbers
Challenge: The 0/1 Knapsack Problem
Solution: The 0/1 Knapsack Problem
Challenge: Staircase Problem
Solution: Staircase Problem
Challenge: The Partition Problem
Solution: The Partition Problem
Challenge: Longest Common Substring
Solution: Longest Common Substring
Challenge: Shortest Common Supersequence
Solution: Shortest Common Supersequence
Challenge: Longest Palindromic Subsequence
Solution: Longest Palindromic Subsequence
Challenge: The Coin Change Problem
Solution: Coin Change Problem
Challenge: Egg Dropping Problem
Solution: Egg Dropping Problem
Challenge: Strings Interleaving
Solution: Strings Interleaving
Challenge: Edit Distance Problem
Solution: The Edit Distance Problem
Quiz on Dynamic Programming
Greedy Algorithms
What is a Greedy Approach?
Challenge: Make a Change Machine
Solution: Make Your own Change Machine
Challenge: Connecting 'n' Pipes with Minimum Cost
Solution: Connecting 'n' Pipes with Minimum Cost
Challenge: Find the Egyptian Fraction
Solution: Find the Egyptian Fraction
Challenge: Minimum Number of Platforms Required for Train Station
Solution: Minimum Number of Platforms Required for TrainStation
Challenge: Help the Police Officers Catch the Thieves
Solution: Help the Police Officers Catch the Thieves
Challenge: Fractional Knapsack
Solution: Fractional Knapsack Problem
Challenge: Find the Largest Number
Solution: Find the Largest Number
Challenge: Color the Graph
Solution: Color the Graph
Challenge: Find the Minimum Spanning Tree
Solution: Kruskal’s Minimum Spanning Tree
Quick Quiz!
Divide and Conquer
Introduction to Divide and Conquer with Binary Search
Pascal's Triangle
Challenge: Euclidean Algorithm
Solution Review 1: Euclidean Algorithm
Challenge: Peak Element
Solution: Peak Element
Challenge: Maximum Subarray Sum
Solution: Maximum Subarray Sum
Challenge: Missing Number in Sorted Array
Solution: Missing Number in Sorted Array
Challenge: Find the Closest Number
Solution: Find the Closest Number
Challenge: Shuffle Integers
Solution: Shuffle Integers
Challenge: Collect Coins in Minimum Steps
Solution: Collect Coins in Minimum Steps
Challenge: Merge a Number of Sorted Arrays
Solution: Merge a Number of Sorted Arrays
Challenge: Find the Floor and Ceiling of a Number
Solution: Find the Floor and Ceil of a Number
Challenge: Inversion Count in an Array
Solution: Inversion Count in an Array
Quiz on Divide and Conquer
Graph Algorithms
Introduction to Graph Algorithms and Implementation
Challenge: Implement Breadth First Search
Solution: Implement Breadth First Search
Challenge: Implement Depth-First Search
Solution: Implement Depth-First Search
Challenge: Calculate the Number of Nodes in a Given Graph Level
Solution: Number of Nodes in a Given Graph Level
Challenge: Print the Transpose of a Graph
Solution: Print the Transpose of a Graph
Challenge: Count the Paths Between Two Nodes
Solution: Count the Paths Between Two Nodes
Challenge: Check if a Graph is Strongly Connected
Solution: Check if a Graph is Strongly Connected
Challenge: Print all the Connected Components in a Graph
Solution: Print all the Connected Components of a Graph
Challenge: Removing a Given Edge
Solution: Removing an Edge
Challenge: Check If Given Graph is Bipartite
Solution: Check if a Given Graph is Bipartite
Challenge: Topological Sorting of a Graph
Solution: Topological Sorting of a Graph
Quiz on Graph Algorithms
Appendix: Auxiliary Source Code
Stack Class
Queue Class
PriorityQueue Class
HashMap Class
ArrayList Class
Conclusion
Overview
Where to go from here
Solution: Strings Interleaving
Let's analyze the different ways to solve the string interleaving challenge.
We'll cover the following
Solution #1: Brute force