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
Which type of navigation involves multiple frames that are linked to a number of other frames?
sesenic [268]

Answer:

1. b)

2. c)

3. c)

4. a)

5. b)

Explanation:

1. and 5. Linear kind of navigation is a system with a sequential manner web pages that are perfect for some sorts of sites that are having information that has to be viewed as a book (5) and when we are talking about that view we are considering one page after another page like we are reading a book. It is also the simplest navigation. This is the explanation for question 1 and question 5.

2. The most well-designed navigation system is an intuitive one because in this design of the website we have website traffic that is easy because it flows from one web page to another web page. It is showing us where to go to find and look for something and even where to go if there is no concrete options for what are we looking for.

3. A Sitemap is referring to the organized hierarchy of links and it is the protocol that is allowing us to search through many links. A Sitemap is having a listing of the URLs for some site and that is why this is the correct answer.

4. In using liner reciprocal navigation the interface should include how frames are left and how many of them are there. The more the frames, the more times the user will spend on them and the site.

8 0
3 years ago
In the legend of sleeping Hallow what does Ichabod Crane fear the most
ahrayia [7]

Ichabod Crane is terrified of the headless horsemen

3 0
3 years ago
Read 2 more answers
What type of internet connection do you think you'd get in Antarctica?
rusak2 [61]
Hello!
My best guess is you would have to use mediocre satellites that float over for internet connection.
3 0
3 years ago
Read 2 more answers
Which item converts a high level language program to low level machine instruction?
vodomira [7]
The compiler translates each source code instruction into the appropriate machine language instruction, an
8 0
3 years ago
Match the following:
Bogdan [553]

Answer:

  1. Operating System.
  2. Laptop.
  3. Convertible computer.
  4. Peripheral.
  5. Desktop Computer.

Explanation:

Operating system is a software that manages the hardware and the software in the system and provides the interface between machine and the user.

Laptops are the portable computing devices which you can carry with you.

Convertible computer have a keyboard that is detachable and can be converted into a tablet.

Peripherals are devices which we can attach to the computer.

Desktop computer is a computing device that not portable at all.

3 0
3 years ago
Other questions:
  • How has science fiction influenced technology
    7·2 answers
  • Allows an administrator to query a dns database and find the host name associated with a specific ip address or
    15·1 answer
  • Is it possible to do Agile project in Waterfall methodology?
    11·2 answers
  • Implement the function:
    6·1 answer
  • How does Frankenstein feel about his creation?
    15·1 answer
  • "Your friend is having a birthday and you want to create a slide-show presentation with pictures of her that you have saved on y
    15·1 answer
  • I know how to design it but I’m confused as to how to write a function code based on the info provided.
    10·1 answer
  • Which option best explains the goal of computer science?
    9·1 answer
  • List three things to be safer online.
    8·1 answer
  • Why do my airpods keep disconnecting from my laptop
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!