Question: Consider an integer array MYARRAY that can hold 1 0 0 values. Do the following. ( a ) Declare the array in your program such

Consider an integer array MYARRAY that can hold 100 values. Do the following.
(a) Declare the array in your program such that it is accessible for all the functions used in your program.
(b) Assume that MYARRAY has 100 integers initialized. Write a C function that searches for an integer 0 in the array MYARRAY on a given number of elements. Thus your design must facilitate searching from element 0 to n, where n99. Count the number of 0s and replace the 0s with a value -1. Print the locations of the 0s when you search from the function.
(c) In your function from Part (b), comment the code wherever possible for clarity.
(d) What is the memory space occupied by MYARRAY?
(e) What is the computational time complexity of the function (number of iterations)?
Note: You need not write the entire program. You need to show the full code only for the function.
Consider an integer array MYARRAY that can hold 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!