Find Kth Largest Element: Use a min-heap to find the k-th largest element.
Merge K Sorted Lists: Practice merging multiple sorted lists using a min-heap.
Top K Frequent Elements: Use a heap for finding the k most frequent elements.
K Closest Points to Origin: Implement a max-heap for finding the closest points to the origin.
Intermediate:
Find Median from Data Stream: Use two heaps (min-heap and max-heap) to maintain the median of a stream of numbers.
Sliding Window Median: Implement sliding window median calculation using heaps.
Reorganize String: Use a max-heap to rearrange characters in a string to avoid consecutive duplicates.
Task Scheduler: Use a heap to schedule tasks with cooling periods efficiently.
Maximal Sliding Window: Use a max-heap to find the maximum value in each sliding window of a given size.
Advanced:
Top K Frequent Words: Use a min-heap to find the most frequent words in a text.
Median of Two Sorted Arrays: Utilize heaps and binary search to find the median of two sorted arrays.
Find Smallest Range Covering Elements from K Lists: Use a min-heap to find the smallest range that includes at least one number from each of the k lists.
Kth Smallest Element in a Sorted Matrix: Use a min-heap to efficiently find the k-th smallest element in a row and column sorted matrix.
Employee Free Time: Use a min-heap to merge intervals and find common free time slots for employees.
9. Graphs
Beginners:
Graph Representation: Learn how to represent graphs using adjacency matrices and lists.
Depth-First Search (DFS): Practice basic graph traversal using DFS.
Breadth-First Search (BFS): Practice basic graph traversal using BFS.
Detect Cycle in Undirected Graph: Use DFS to detect cycles.
Connected Components: Use DFS or BFS to find all connected components in a graph.
Intermediate:
Topological Sort: Implement topological sorting for directed acyclic graphs (DAGs).
Shortest Path in Unweighted Graph: Use BFS to find the shortest path in an unweighted graph.
Dijkstra's Algorithm: Implement Dijkstra's algorithm for shortest paths in weighted graphs.
Minimum Spanning Tree (Prim's/Kruskal's): Implement MST algorithms.
Detect Cycle in Directed Graph: Use DFS and graph coloring to detect cycles.
Advanced:
Bellman-Ford Algorithm: Implement Bellman-Ford for shortest paths with negative weights.
Floyd-Warshall Algorithm: Use this algorithm for all-pairs shortest paths.
Johnson's Algorithm: Implement Johnson’s algorithm for all-pairs shortest paths in sparse graphs.
Maximum Flow (Ford-Fulkerson/Edmonds-Karp): Implement algorithms to find the maximum flow in a network.
Graph Coloring: Use backtracking and greedy techniques for graph coloring problems.
10. Tries
Beginners:
Insert and Search Operations: Learn the basic operations of a Trie (insert, search).
Autocomplete System: Implement a simple autocomplete system using Tries.
Count Words with Given Prefix: Use Tries to count words with a given prefix.
Delete Operation in Trie: Implement the delete operation in a Trie.
Find Longest Common Prefix: Use a Trie to find the longest common prefix of a set of strings.
Intermediate:
Word Search II: Implement a Trie to solve the word search problem on a 2D board.
Implement Magic Dictionary: Use a Trie to design a dictionary with search functionality that supports one modification.
Replace Words in a Sentence: Use a Trie to replace words in a sentence with their root forms.
Concatenated Words: Use a Trie to find all concatenated words in a given list.
Palindrome Pairs: Use a Trie to find all pairs of words that form a palindrome when concatenated.
Advanced:
Maximum XOR of Two Numbers in an Array: Use a Trie to find the maximum XOR of two numbers in an array.
Design Search Autocomplete System: Implement a more complex autocomplete system that supports weights and sorting.
Stream of Characters: Use a Trie to design a data structure that checks if a sequence of characters forms a word.
Longest Word in Dictionary: Use a Trie to find the longest word in a dictionary that can be built one character at a time.
Search Suggestion System: Use a Trie to create a search suggestion system that suggests products based on a search query.
Want to print your doc? This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (