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

Which of these is a function of the digestive system ? A. Transports nutrients to other organs. B. Eliminates non digestible waste. C. Regulates blood flow D.
Please help me out!!!!!.........
can anybody help me on this
What’s the answer to this?
Look at this rectangle
The polymerase chain reaction makes DNA fingerprinting more reliable because it: A. allows the use of a larger amount of DNA for testing. B. allows the use of
Are the bases on the interior or the exterior of the double helix? Are they randomly arranged or neatly stacked?
GUYS, PLEASE HELP ME PLEASE. THANKS.
When discussing comparative and absolute advantage, which best describes specialization? A. developing expertise in certain types of production B. limiting the
7. The population size of a species capable of being supported by the environment is called its ________.