PhoneBook search ALgorithm

Hi i need to write phonebook search algorithm!if we have names
Aram
Aren
Atin
Banett
Clara
if i write A it will show first 3 than i can input r it will show onli first two etc. i want to know the fastest way to do this!
Probably a preordered binary search. Take a look at the standard functions sort()

http://www.cplusplus.com/reference/algorithm/sort/?kw=sort

and lower_bound():

http://www.cplusplus.com/reference/algorithm/lower_bound/?kw=lower_bound
Topic archived. No new replies allowed.