Showing 3 of 7 questions
Determine the number of disconnected groups (connected components) within a given undirected graph. You're provided the graph's edges and need to find how many separate, reachable islands of nodes exist.
#1. Number of Connected Components in an Undirected Graph
Design a data structure that efficiently stores a set of strings and allows for prefix-based searches. Implement methods to insert strings, search for complete words, and check if any word starts with a given prefix.
#2. Implement Trie (Prefix Tree)
Design a data structure that acts as a Least Recently Used (LRU) cache. Implement methods to get and put key-value pairs, evicting the least recently used entry when the cache is full.
#3. LRU Cache
Page 1 of 1 · 7 total