Page 1 of 1

Write a program in which there is a membership file in which there are records such as name and telephone number. Let’s

Posted: Sat Nov 27, 2021 10:26 am
by answerhappygod
Write a program in which there is a membership file in which
there are records such as name and telephone number. Let’s suppose
we must find a name called Elena. One way to do this is to linearly
search the name of member through the list of n=100000 members
through linear search. The average number of comparisons in the
file with n records would be equal to n/2. Complexity of linear
search would be C(n)= n/2. In another case if names in the file are
alphabetically sorted then apply binary search algorithm. The
complexity of binary search is C(n)= log2n.
The programming solution should be in C++ language.