⬅ Previous Topic
Strongly Connected Components using Kosaraju's AlgorithmInserted Words | Search Word | Expected Result | Explanation |
---|---|---|---|
["apple", "banana", "grape"] | "banana" | true | "banana" was inserted and fully matches, so the search returns true. Visualization |
["apple", "banana", "grape"] | "ban" | false | "ban" is a prefix of "banana" but not a complete word in the Trie. Visualization |
[] | "apple" | false | No words are inserted, so the search will always return false. |
["cat", "dog"] | "" | false | An empty search string is not considered a valid word in the Trie. |
["one", "only", "once"] | "only" | true | The word "only" exactly matches a word in the Trie. Visualization |
["one", "only", "once"] | "on" | false | "on" is a prefix shared by multiple words but is not a full word in the Trie. Visualization |