1. (a) Write a recursive o function for performing binary search on an array of integer. Show how to use this function with sample call from main(). For an input array A={2,6,8,14, 18, 19,37,46, 77}, show each step of algorithm when searching for the value (i) 46 (ii) 17 in the array. (b) Give a structure for storing a active COVID cases in a state. It should consist of the state name (20 characters)and number of active COVID 19 cases (integers) in each state. Each of the 250 students of Btech 1st year (all sections). Inside main () create and array of structure type for holding this information. Write a function that sorts this array in ascending order of active COVID 19 cases, so that we can rank the states in order of the number of cases in each state of the country.  (c) Write a function called input() that reads the content of 2-D array( A matrix) row by row. Write a second C function called mult() that takes two matrices and their dimensions as argument and computes. Their product this function should also check if dimensions of the two matrices matches printing an error if they don't. Write a third C function called disp(),that display a matrix column by column. Using these three functions, write a C program that read two matrices,compute their product and display it. You may declare sufficiently large 2-Darray that have enough space for storing your input and output matrices. Assume that the content of the matircs are floating point numbers.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

1.

(a) Write a recursive o function for performing binary search on an array of integer. Show how to use this function with sample call from main(). For an input array A={2,6,8,14, 18, 19,37,46, 77}, show each step of algorithm when searching for the value (i) 46 (ii) 17 in the array.


(b) Give a structure for storing a active COVID cases in a state. It should consist of the state name (20 characters)and number of active COVID 19 cases (integers) in each state. Each of the 250 students of Btech 1st year (all sections). Inside main () create and array of structure type for holding this information. Write a function that sorts this array in ascending order of active COVID 19 cases, so that we can rank the states in order of the number of cases in each state of the country. 


(c) Write a function called input() that reads the content of 2-D array( A matrix) row by row. Write a second C function called mult() that takes two matrices and their dimensions as argument and computes. Their product this function should also check if dimensions of the two matrices matches printing an error if they don't. Write a third C function called disp(),that display a matrix column by column. Using these three functions, write a C program that read two matrices,compute their product and display it. You may declare sufficiently large 2-Darray that have enough space for storing your input and output matrices. Assume that the content of the matircs are floating point numbers.

Expert Solution
steps

Step by step

Solved in 6 steps with 19 images

Blurred answer
Knowledge Booster
Quicksort
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education