I have a sorted list of string elements(names of cities) and I would like to implement binary search on this and filter out cities by giving initial letters?
for example input by user: http://127.0.0.1:8000/api/?city=New
So here in this case I need to find out cities starting from New
Sample Output:
[
"New Abbey|Ceredigion|United Kingdom",
"New Albany|Indiana|United States",
"New Albany|Kansas|United States",
"New Albany|Mississippi|United States",
"New Albany|Ohio|United States"
]
Please advise.