Home
Data Structures and Algorithms
Complexity Analysis
Arrays
Searching & Sorting
Linked Lists
Stacks
Queues
Heaps & Priority Queues
Hashing
Trees
Graphs
Tries
Math & Bit Manipulation
Greedy Algorithms
Backtracking
Dynamic Programming
Summary
About
Dark
Guide contents
Data Structures and Algorithms
Complexity Analysis
1.
Big O and Time Complexity
2.
Space Complexity and a Complexity Cheat Sheet
Arrays
3.
Arrays in Java Interviews
4.
Remove Even Integers From an Array
5.
Merge Two Sorted Arrays
6.
Find Two Numbers That Add Up to k
7.
Product of Array Except Self
8.
Find the Minimum Value in an Array
9.
First Non-Repeating Integer in an Array
10.
Find the Second Maximum Value in an Array
11.
Rotate Array
12.
Rearrange a Sorted Array in Max/Min Form
13.
Maximum Subarray (Kadane's Algorithm)
14.
Rotate a Matrix by 90 Degrees
15.
Spiral Matrix
16.
Sort an Array in Wave Form
17.
Set Matrix Zeroes
18.
Maximum j - i Such That a[j] > a[i]
19.
Move Zeroes to the End
20.
Container With Most Water
21.
Remove Duplicates From a Sorted Array
22.
Longest Common Prefix
Searching & Sorting
23.
Search for a Range in a Sorted Array
24.
Find the Minimum in a Sorted and Rotated Array
25.
Find an Element in a Bitonic Array
26.
Median of Two Sorted Arrays of the Same Size
27.
Count Inversions in an Array
28.
Median in a Row-Wise Sorted Matrix
Linked Lists
29.
Linked Lists in Java
30.
Insertion at the Tail of a Linked List
31.
Search in a Singly Linked List
32.
Delete a Value From a Linked List
33.
Find the Length of a Linked List
34.
Reverse a Linked List
35.
Detect a Cycle in a Linked List
36.
Middle of the Linked List
37.
Remove Duplicates From a Linked List
38.
Union and Intersection of Linked Lists
39.
Return the Nth Node From the End
40.
Check if a Doubly Linked List Is a Palindrome
41.
Swap Nodes in Pairs
42.
Add Two Numbers Represented as Linked Lists
43.
Reverse a Linked List From Position m to n
44.
Detect and Remove a Loop in a Linked List
45.
Merge Two Sorted Linked Lists
46.
Sort a Linked List Using Insertion Sort
47.
LRU Cache
Stacks
48.
Stacks in Java
49.
Implement Two Stacks Using One Array
50.
Sort Values in a Stack
51.
Evaluate a Postfix Expression
52.
Next Greater Element
53.
Valid Parentheses
54.
Min Stack
55.
Find the Celebrity
56.
Trapping Rain Water
57.
Merge Overlapping Intervals
58.
Largest Rectangle in a Histogram
Queues
59.
Queues in Java
60.
Generate Binary Numbers From 1 to n Using a Queue
61.
Reverse the First k Elements of a Queue
62.
Implement a Queue Using Stacks
63.
Sliding Window Maximum
Heaps & Priority Queues
64.
Heaps and PriorityQueue in Java
65.
Convert a Max Heap to a Min Heap
66.
Find the k Smallest Elements in an Array
67.
Find the k Largest Elements in an Array
68.
Find K Pairs With the Smallest Sums
69.
Merge K Sorted Linked Lists
Hashing
70.
HashMap and HashSet in Java
71.
Check if an Array Is a Subset of Another
72.
Check if Two Arrays Are Disjoint
73.
Find Symmetric Pairs in an Array
74.
Trace the Complete Path of a Journey
75.
Find Two Pairs Such That a + b = c + d
76.
Find a Subarray With a Sum of 0
77.
Word Formation Using a Hash Table
78.
Find Two Numbers That Add Up to k (Hashing)
79.
First Non-Repeating Integer (Hashing)
80.
Linked List Cycle (Hashing)
81.
Remove Duplicates From a Linked List (Hashing)
82.
Union and Intersection of Linked Lists (Hashing)
83.
Check if Two Arrays Are Equal
84.
Intersection of Two Unsorted Arrays
85.
Longest Consecutive Sequence
86.
Valid Anagram
87.
Majority Element
88.
Sort Characters by Frequency
89.
Triplets With a Sum of 0 (3Sum)
90.
First Missing Positive
91.
Largest Subarray With a Sum of 0
92.
Max Points on a Line
Trees
93.
Binary Trees and BSTs in Java
94.
Find the Minimum Value in a BST
95.
Find the kth Maximum Value in a BST
96.
Find the Ancestors of a Node in a BST
97.
Find the Height of a Binary Tree
98.
Find Nodes at k Distance From the Root
99.
Lowest Common Ancestor of a Binary Tree
100.
Path Sum in a Binary Tree
101.
Minimum Depth of a Binary Tree
102.
Binary Tree Zigzag Level Order Traversal
103.
Invert a Binary Tree
104.
Flatten a Binary Tree to a Linked List
105.
Diameter of a Binary Tree
106.
All Nodes at Distance K in a Binary Tree
107.
Merge Two Binary Trees
108.
Convert a Sorted Array to a Balanced BST
109.
Minimum Absolute Difference in a BST
110.
Recover a Binary Search Tree
111.
Merge Two BSTs Into a Sorted List
Graphs
112.
Graphs in Java
113.
Implement Breadth-First Search
114.
Implement Depth-First Search
115.
Detect a Cycle in a Directed Graph
116.
Course Schedule
117.
Find a Mother Vertex in a Directed Graph
118.
Count the Edges in an Undirected Graph
119.
Check if a Path Exists Between Two Vertices
120.
Graph Valid Tree
121.
Find the Shortest Path Between Two Vertices
122.
Remove an Edge From a Directed Graph
123.
Word Ladder
124.
Smallest Multiple Made of 0s and 1s
125.
Check for a Loop in an Array of Jumps
126.
Minimum Knight Moves on a Chessboard
127.
Surrounded Regions
Tries
128.
Tries in Java
129.
Total Number of Words in a Trie
130.
Find All Words Stored in a Trie
131.
Sort an Array of Strings Using a Trie
132.
Word Formation From a Dictionary Using a Trie
133.
Shortest Unique Prefix of Every Word
Math & Bit Manipulation
134.
Roman to Integer
135.
Reverse Bits
136.
Square Root of an Integer
137.
Calculate the Power Function
138.
Greatest Common Divisor
139.
Find the Closest Palindrome
Greedy Algorithms
140.
Maximum Product of Three Numbers
141.
Gas Station
142.
Distribute Candy
143.
Fractional Knapsack
Backtracking
144.
Generate Parentheses
145.
Generate All Subsets
146.
Combinations
147.
Combination Sum
148.
Letter Combinations of a Phone Number
149.
Sudoku Solver
Dynamic Programming
150.
Climbing Stairs
151.
Coin Change: Fewest Coins
152.
Word Break
153.
Minimum Cost Path in a Grid
154.
Maximal Square
155.
Maximum Product Subarray
156.
Minimum Number of Jumps to Reach the End
157.
Longest Increasing Subsequence
158.
Longest Arithmetic Progression
159.
Partition Equal Subset Sum
160.
Edit Distance
161.
Interleaving String
162.
Palindrome Partitioning: Minimum Cuts
163.
Matrix Chain Multiplication
Summary
164.
Choosing a Data Structure and Interview Strategy
Home
/
Data Structures and Algorithms
/
Stacks
Stacks
Stack problems.
11 lessons
48.
Stacks in Java
49.
Implement Two Stacks Using One Array
50.
Sort Values in a Stack
51.
Evaluate a Postfix Expression
52.
Next Greater Element
53.
Valid Parentheses
54.
Min Stack
55.
Find the Celebrity
56.
Trapping Rain Water
57.
Merge Overlapping Intervals
58.
Largest Rectangle in a Histogram