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
horrorfan [7]
3 years ago
8

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; else index++; } if(found==true) return index; else return -1; } a. Add another parameter to indicate where to stop searching b. Add another parameter to indicate where to start searching c. This already can find all occurrences of a given target d. Have the function return the whole array
Computers and Technology
1 answer:
Naddika [18.5K]3 years ago
7 0

Answer:

The answer is "Option b".

Explanation:

In the given question, a function "search" is defined. That searches element that is passed in the function by parameter. To search more quickly we must add another parameter in the function. and other options are not correct that can be described as:

  • In option a, We add another element in parameter to start searching not to stop.
  • In option c, The function can not find an element that occurs in the array target.
  • In option d, Function will not return array it will return only index value.

You might be interested in
The most important hardware device for connecting supercomputers over a wide area
juin [17]

Answer:

Hel

Explanation:

I think that they are:

  • <u>Processo</u><u>rs</u><u>:</u> Super computers posses tens of thousands of processors for performing billions of intensive computations on a single second.
  • <u>Memory</u><u>:</u> Supercomputers feature high volumes of memory, which allows the unit to access information at a given time.

7 0
3 years ago
Write the name of the tab, the command group, and the icon that you need to use to justify
Dafna11 [192]

Answer:

Tab: Home Tab

Command Group: Paragraph

Icon: Justify Icon

<em>The icon has no name; rather it is represented by 4 horizontal lines that are aligned on both edges</em>

<em />

Explanation:

To answer this question, I'll make use of the following attachment

<em>Where</em>

<em>1- represents the home tab</em>

<em>2 - represents the paragraph</em>

<em>3 - represents the justify icon</em>

<em />

3 0
4 years ago
Define file organization
galben [10]

To organize all files in the appropriate folders for easy and quick access

4 0
2 years ago
Read 2 more answers
One way to increase savings is to _____ cash inflows
Arlecino [84]

I beleive anything to do with manage

4 0
3 years ago
Why is it unlikely that you will find the ip address 192.168.250.10 on the internet?
gayaneshka [121]
That IP address is either Internal, private or reserved
5 0
4 years ago
Other questions:
  • in Google, how should you phrase your search if you want to exclude a certain word from your results(for example,"chocolate")?
    14·1 answer
  • Two good guidelines for good readability on a website are ______ (choose two)
    14·1 answer
  • Which of the following is a valid formula?<br> (C2-D16)<br> O A2/F2<br> O=B5/10<br> O =E10
    14·1 answer
  • Some program menus are the same in every program you open. Under the File menu, all of the following are the same in every progr
    6·1 answer
  • In this lab, you will use all of the graphics commands you have learned to create an animated scene. Your program should have a
    10·1 answer
  • What is an Operating system??
    5·1 answer
  • Is brainly bugging out rn? <br> The site isnt like loading completely
    5·1 answer
  • Dad Mystery
    9·2 answers
  • Practising some questions for board exams for class 12 python,pls help with detailed answer
    14·1 answer
  • what is the name of the program that enables the device and operating system to communicate with each other?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!