Description
Complete the program that has an array containing the countries with confirmed Novel Coronavirus cases. There is a full initialization list of the following countries:
Write a linear search function and a binary search function. Both functions should return true if the country was found and false if the country was not found.
Call the following functions in the order listed below:
- linear search function
- sort function
- print function
- binary search function
Sample Output 1:
What is the name of your country? United States
Linear Search says that your country does have a confirmed case of the Coronavirus.
Sorted list of countries:
Australia
Canada
China
Finland
France
Germany
Hong Kong
India
Italy
Japan
Spain
Sweden
Thailand
United Kingdom
United States
Binary Search says that your country does have a confirmed case of the Coronavirus.
Sample Output 2:
What is the name of your country? Bangladesh
Linear Search says that your country does not have a confirmed case of the Coronavirus.
Sorted list of countries:
Australia
Canada
China
Finland
France
Germany
Hong Kong
India
Italy
Japan
Spain
Sweden
Thailand
United Kingdom
United States
Binary Search says that your country does not have a confirmed case of the Coronavirus.