java.lang.Object
com.csse3200.game.ui.terminal.autocomplete.RadixTrie

public class RadixTrie extends Object
Compressed (radix) trie with per-node cached top-5 completions. Insert all command names once; suggestions are then O(m + k) where: - m = prefix traversal, k = number of edges inspected on the path. Returns at most 5 suggestions in lexicographic order.
  • Constructor Details

    • RadixTrie

      public RadixTrie()
  • Method Details

    • clear

      public void clear()
    • insert

      public void insert(String word)
    • suggestTopK

      public List<String> suggestTopK(String prefix)