Given a list of words - what would be a good algorithm to complete a word in java? Trade-offs: speed / efficiency / memory size

I am studying the hardware / software requirements (the end goal is a Java mobile application) for a potential free / paid application.

An application starts with this simple goal: Define a list of relevant words in the database to complete the word on a single line input.

In other words, I already know the contents of the database, but the amount of memory / speed / search efficiency of the algorithm will determine the amount of supported data.

I start with suffix tree searches first, but I wonder if anyone has any experience compiling the speed and memory size of this simple approach and the more complex ones that are discussed at conferences.

Honestly, the original application has apparently less than 500 words in context, so it may not matter, but in the end, the application can expand to tens of thousands or hundreds of thousands of records - so the question is speed and memory.

I believe that I could start with something simple and switch later, but I hope to understand the compromise sooner!

+3
source share
1 answer

The completion of a word suggests that you want to find all words starting with this prefix.

Tasks are good for this, and especially good if you add or remove items β€” no other nodes need to be redistributed.

, , : ! , , , , .

+2

Source: https://habr.com/ru/post/1714667/


All Articles