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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply