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
Dovator [93]
4 years ago
8

The elements of an integer-valued array can be set to 0 (i.e., the array can be cleared) recursively as follows: An array of siz

e 0 is already cleared; Otherwise, set the first element of the array to 0, and clear the rest of the array Write a void function named clear that accepts an integer array, and the number of elements in the array and sets the elements of the array to 0.
Computers and Technology
1 answer:
marta [7]4 years ago
7 0

Answer:.......

void clear(int *array, int length){

 

  if (length == 0)return;  

 

  array[0] = 0;  

 

  clear(array + 1, length-1);

}

Explanation:

The void function accepts an integer array.

You might be interested in
When installing a Windows 10 an already installed Windows 7 what happen​
astra-53 [7]

Answer:

are u updating it? or u r rooting it?

4 0
3 years ago
Read 2 more answers
Which of the following declares an abstract method in an abstract C++ class? (Points : 2) public: void print();
Dahasolnce [82]

Answer:

public: virtual void print()=0;

Explanation:

An abstract class contains a pure virtual function. Pure virtual class cannot be instantiated but it can be subclassed and the subclass can provide an implementation of the function.

A virtual function declaration in the class is preceded by the virtual keyword. For example, virtual void print();

A pure virtual function declaration is followed by '=0;'

public: virtual void print()=0;

4 0
4 years ago
I don't know how to explain what is motion in my own words
marusya05 [52]
Motion is the movement of a body part or an object
8 0
4 years ago
Read 2 more answers
Determine the number of character comparisons made by the brute-force algorithm in searching for the pattern GANDHI in the text
leonid [27]

Answer:

Total number of character comparison = 43

Explanation:

Using the Brute force algorithm

The string of n characters is known as text, and the string of m characters is known as the pattern.

From the given information:

The text (n)=THERE_IS_MORE_TO_LIFE_THAN_INCREASING_ITS_SPEED

The pattern (m) = GANDHI

The total no of characters that we have in the text = 47

The total number of characters in pattern = 6

For a brute force algorithm;

Since; the first character of the pattern does not exist in the text, then the number of trials made can be attempted can be expressed as = n – m + 1

= 47 – 6 + 1

= 47 – 5

= 42

Thus; the algorithm will attempt the trial 42 times.

Now, for loop in the algorithm to run 42 times, the G in the pattern will have to align against the for T in the text, and in the last case, it will be aligned against the last space.

On each attempted trial, the algorithm will make one unsuccessful comparison.

However, at the trial at which the G in the pattern Is aligned with the G in the text, there will be two successful comparisons.

Hence, we can calculate the total number of character comparison as follows:

Total number of character comparison = \mathbf{\bigg ( ( 42 -  (no. \ of \  failed \ comparison) ) \times 1 + (1 \times ( Two \ successful \  comparisons) ) \bigg ) }

Total number of character comparison = ( (( 42 – 1) × 1 ) + ( 1 × 2) )

Total number of character comparison = 41 + 2

Total number of character comparison = 43

3 0
3 years ago
Alexi is writing a program which prompts users to enter their race times without decimals. Which function should she use?
Juli2301 [7.4K]

Answer:

It's either B or C

Explanation:

I saw this on another brainly but they said it wasn't print so id say b is most likely

6 0
3 years ago
Read 2 more answers
Other questions:
  • You use worksheets to perform calculations. How do you perform these calculations?
    15·2 answers
  • Which of the following is a true statement about psychological tests administered by computers? computers make standardization e
    9·1 answer
  • The main purpose of a constructor is to initialize the data members at the moment that an object is created. true or false?
    8·1 answer
  • Let's go! About to hit 40k!!! Glad to help on Brainly®!!!
    11·1 answer
  • Both aliases and functions can be used to store commands that can be executed, but functions can also accept positional paramete
    14·1 answer
  • What type of waves in the electromagnetic spectrum has the Search for Extraterrestrial Intelligence (SETI) mostly analyzed in th
    15·1 answer
  • What is the meaning of the term plot?<br>A. the final outcome of the story​
    8·1 answer
  • Research and recommend the most appropriate VPN technology. The most likely solution is either an Internet Protocol Security (IP
    5·1 answer
  • Released in 1976, the Apple I was Apple Computer's first product.<br><br> O True<br> O False
    6·1 answer
  • Changing how information is represented so that it can be read by a computer is called
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!