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.
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
(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.
Step by step
Solved in 6 steps with 19 images