arrays - Search Algorithm with Incomplete Input -


i need algorithm search array string, string may not same 1 of items in array. example,

array = {"stack", "over", "flow", "stake"} input = "sta" 

it need recognize stack , stake both match parameters , choose 1 first in alphabetical order. how can this?

loop on sorted array, compute levenshtein distance between each string , target string, , if sufficiently small, return.

what constitutes "sufficiently small" you. you'll have testing.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -