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
What are vertical sets of cells called
Nady [450]
A vertical group of cells are called (C) column
6 0
3 years ago
Read 2 more answers
Dashed lines that display on your slide when you are moving an object and that assist you with alignment are referred to as:
Umnica [9.8K]
Smart guides is the answer.
7 0
3 years ago
Read 2 more answers
:)
Vilka [71]

Answer:

A, system software

Explanation:

that is answer an interpreter is a type of system software

5 0
3 years ago
Linda is the education manager for a national coding service company. Once a month she holds a videoconference with all her codi
Andru [333]

Answer:

Option (D) i.e., synchronous is the correct option to the following question.

Explanation:

The following statement are the synchronous type of training because it is the type of training which is given to students or the persons for the purpose of knowledge in present time and the trainer or that person who give them information they can receive feedback and message at that time and all persons has permission to ask questions with them.

Option C is incorrect because in this type of training the interaction between the trainer and the receiver could not be established.

Option A is incorrect because the classroom-based training only for that person or the students who are available at that time at that place and in this video conferencing is not available.

8 0
3 years ago
The power relationship on a transformer states that O Power in = power out + loss O Power in = 1/2 power out (Power in = 2 x pow
lions [1.4K]

Answer:

D

Explanation:

5 0
3 years ago
Other questions:
  • The linux and macos program traceroute is known by a slightly different name on windows. it's referred to as ______.
    5·1 answer
  • Which directory in the FHS stores programs and configuration information that can only be executed and modified by the root user
    10·1 answer
  • When should students practice netiquette in an online course?
    9·1 answer
  • What are the five types of alignment in Word?
    12·2 answers
  • A wide variety of "apps" are available to customize devices. Which category of app does word processing software fall into? Ente
    6·1 answer
  • An organization requires secure configuration baselines for all platforms and technologies that are used. If any system cannot c
    7·1 answer
  • Are you allowed to copy and paste answers on brainy to give answers to other people?
    5·2 answers
  • Why is dark supereffective against ghost?
    5·2 answers
  • Porque es importante la tecnología?​
    8·1 answer
  • What are the three algorithm constructs?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!