Fanboi Channel

แปะลิงค์ต่าง ๆ ของ Tutorial สาย Tech ไม่ว่าจะเป็น Programming, Gadget,

Last posted

Total of 340 posts

103 Nameless Fanboi Posted ID6:PGnirFjEOo

Yes, there are many LeetCode questions that use Trie nodes. Here are a few examples:

Implement Trie (Prefix Tree): This is a classic Trie problem that asks you to implement a data structure that supports inserting words and searching for words with a given prefix.

Word Search II: This problem asks you to find all the words in a given dictionary that can be formed by concatenating adjacent letters in a 2D board. You can use a Trie to efficiently store the dictionary words and search for matches in the board.

Shortest Palindrome: This problem asks you to find the shortest palindrome you can create by adding letters to the beginning of a given string. You can use a Trie to find the longest suffix of the given string that is also a palindrome, and then add the remaining letters in reverse order to the beginning of the string.

Maximum XOR of Two Numbers in an Array: This problem asks you to find the maximum XOR of any two integers in a given array. You can use a Trie to efficiently store the binary representations of the array elements and search for pairs that produce the maximum XOR.

Design In-Memory File System: This problem asks you to design a simple in-memory file system that supports basic operations like creating directories and files, and reading and writing file contents. You can use a Trie to efficiently store the file system hierarchy and perform operations like navigating to a directory or finding a file.

These are just a few examples, but there are many other LeetCode problems that use Trie nodes in various ways.

Be Civil — "Be curious, not judgemental"

  • FAQs — คำถามที่ถามบ่อย (การใช้บอร์ด การแบน ฯลฯ)
  • Policy — เกณฑ์การใช้งานเว็บไซต์
  • Guidelines — ข้อแนะนำในการใช้งานเว็บไซต์
  • Deletion Request — แจ้งลบและเกณฑ์การลบข้อความ
  • Law Enforcement — แจ้งขอ IP address

All contents are responsibility of its posters.