Just a doubt: for very big board, if we just want to query a few words, does pure backtrack will save time?


  • 0

    In order to use trie solution, seems we have to do DFS to every cell of the board. For big dictionary of words, the computation worth it. But if the user just want to query some words, would pure backtrack will be faster? In pure backtrack solution, if found, DFS can terminate early.


  • 0

    I think probably you can paster some code here for us to check further, just a suggestion ^^


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.