[Gambas-devel] [Gambas-devel-svn] SF.net SVN: gambas:[6578] gambas/trunk

Tobias Boege taboege at ...176...
Sun Oct 26 09:53:25 CET 2014


On Sun, 26 Oct 2014, gambas at ...1... wrote:
> [GB.FORM]
> * NEW: Completion is a new class to implement automatic completion on an
>   already existing TextBox.

Keep in mind that the Trie class in gb.data can do completion of an
arbitrary prefix P of length M among N strings in time O(M) where
the naive approach of searching the strings for the longest common
prefix containing P (like in two nested For loops) would be O(N*M).

The Trie scales even better if your prefixes become finer-grained
over time (like if a human is typing a specific word), then you can
incorporate a new letter in quasi-constant time.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the Devel mailing list