Problem 2. In the following array of C-strings char* names[] = {"DEF", "BBB", "EE", "AA", "CAB", "AAA", "DDDD", "BBB", "FFFF", "CCCC"}; char* favoriteName="AA"; Use generic binary search both iterative and recursive to find the favoriteName in the names array.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 16PE
icon
Related questions
Question

Please solve and show work. Using C / C++ language.

In the following array of C-strings

char* names[] = { “DEF”, “BBB” , “EE”, “AA”, “CAB”, “AAA”, “DDDD”, “BBB”, “FFFF”, “CCCC”};

char* favoriteName= “AA”;

Problem 2. In the following array of C-strings
char* names[] = {"DEF", "BBB", "EE", "AA", "CAB", "AAA", "DDDD", "BBB", "FFFF", "CCCC"};
char* favoriteName="AA";
Use generic binary search both iterative and recursive to find the favoriteName in the names array.
Transcribed Image Text:Problem 2. In the following array of C-strings char* names[] = {"DEF", "BBB", "EE", "AA", "CAB", "AAA", "DDDD", "BBB", "FFFF", "CCCC"}; char* favoriteName="AA"; Use generic binary search both iterative and recursive to find the favoriteName in the names array.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning