Find matching dictionary words given a Scrabble tray
The way to use a trie here is to sort the letters of each dictionary word:

[ AD, ADD, DAD ] becomes A &gt; D [ ad ] &gt; D [ add, dad ]

Then walk the trie and stop descending when isWordInTray returns false.

Worst-case complexity is unchanged (arguably worse, since sorting time is not linear); actual runtime is greatly improved.