1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Blizzard [7]
3 years ago
7

Given the following function definition, what modifications need to be made to the search function so that it finds all occurren

ces of target in the array?int search(const int array[], int target, int numElements){int index=0;bool found=false;while((!found) && (index < numElements)){if(array[index] == target)found=true;elseindex++;}if(found==true)return index;elsereturn -1;}a. Add another parameter to indicate where to stop searchingb. Add another parameter to indicate where to start searchingc. This already can find all occurrences of a given targetd. Have the function return the whole array
Computers and Technology
1 answer:
svet-max [94.6K]3 years ago
8 0

Answer:

D. have function return the whole array

Explanation:

the given function only return first occurrence of target. In order to get all occurrences of target we have to change condition in while loop to check whole array even if first occurrence of target found and plus add another parameter of type array that will store different  indexes of occurrence of target and return that array

You might be interested in
Select the correct answer from each drop-down menu.
xenn [34]

Answer:

Siftable are small independent computer that are capable of BLANK (graphics audio video)

4 0
3 years ago
Why laptop computer is called micro computer?​
Eduardwww [97]

Answer:

A lot top is a microcomputer because Michael computer has all the devices that you can use

3 0
3 years ago
Include the source code with comments for all modules in lab. you do not have to include test bench code. code without comments
hoa [83]
I like the UCF Football coach

7 0
3 years ago
Please help me with computing!
Sladkaya [172]

Answer:

ok i help

Explanation:

3 0
3 years ago
What is the core function of an enterprise platform
7nadin3 [17]

Answer:

The core function of an enterprise platform is that it connects the supplier with the consumer

4 0
2 years ago
Other questions:
  • Describe mobile computing
    7·1 answer
  • Question 12 :A user complains that his computer is taking a long time to boot. During the boot process, you observe that the har
    7·1 answer
  • Kevin has to decide on a financial service provider that will help him with his needs related to tax exemptions and payments. He
    10·1 answer
  • Easy upgrade from windows xp to windows 7
    7·1 answer
  • I have a question. This question will probably be deleted, but why do moderators keep deleting my answers when they are legitima
    13·1 answer
  • At currents as low as
    5·1 answer
  • Please explain what is Ribbon?  give examples​
    7·2 answers
  • Before u can open and edit a file, you need to zip it, T/F
    12·1 answer
  • Which browser feature will delete your history, cache, and cookies the moment you close the special window
    6·1 answer
  • The force of impact is
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!