cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
PhoneBook search ALgorithm
PhoneBook search ALgorithm
Sep 4, 2014 at 9:58pm UTC
Lafuzzer
(1)
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!
Sep 5, 2014 at 5:48am UTC
coder777
(8444)
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.