byeol3182 byeol3182
  • 19-04-2018
  • Computers and Technology
contestada

Why should a function that accepts an array as argument also accept an argument specifying the array's size?

Respuesta :

penyou
penyou penyou
  • 20-04-2018
An array is of fixed size. You'd set it to a certain size, but it may be the case that the array is not "full", as in you have not used all its "slots", thus you wouldn't want to waste time traversing through the entire array even if after a certain position all the slots are empty. Thus keeping track of the slots that are actually in use, will save time. Accepting an array's size as an argument will guarantee that say a loop only iterates the necessary number of time.
Answer Link

Otras preguntas

The Constitution was a result of multiple legislatures. agreements. compromises. populations.
Why are scientific journals such as nature and journal of the American medical association extremely important to scientific progress?
What are two reasons a common measuring system is important? Make sure you answer in complete sentences.
What is the distance between -9 and -3??
Sumerian city-states were ruled by councils elected by the citizens. a. True b. False
Juliana’s exercise partner is running a high fever and feels nauseous. She also has a rapid heart rate. What should Juliana do?
Why is loving your family a really important value?
Who originally developed the Vedas
How many moles of solute are contained in a 250.0 ml solution with a concentration of 2.5 M?
Round 17.46 to the nearest whole number