I have an array of n strings. I want to select all the elements of the array that has a given string.
Sorry if that is not clear. I'll give an example.
input = "as"
array = {"abas", "aras", "as", "ask", "asi", "aso", "atas", "best", "test"}
output = {"abas", "aras", "as", "ask", "asi", "aso", "atas"}
Which algorithm will I need to do this selection. I need the fastest algorithm that will perform this operation since I'm using it for autoComplete in android So the search should be faster than the typing speed of the user. I have total 20000 entries.
asor you want it to be a substring? Either correct your question or your output? you wrote starts with in the explanation but you wroteatasandabasin your output for the inputas.