I would like to implement a simple class (in Java) that will allow me to register and unregister strings, and based on the current set of strings, will automatically fill in the given string. Thus, the interface will be:
- void add (String)
- void remove (String)
- String complete (String)
What is the best way to do this in terms of algorithms and data structures?
source
share