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

Points of intersection??? a)x^2+y^2=5 x-y=1 b)y=x^3-4x y=-(x+2) c)y=x^3-2x^2+x-1 d)x=3-y^2 y=x-1
What is the rate and unit rate of 40 meters in 16 seconds
What's the movement of a stationary object?
What is the value of expression? 5−8 • 5−4
100 is 1/10 of what?
What would happen to the brightness of the bulb in the following circuit as I increase the resistance of the variable resistor? Explain your answer
Write an algebraic expression The quantity 9 more than a number
Which element combination(s) would result in electrons being shared?[] sodium (Na) and oxygen (O)[] carbon (C) and fluorine (F)[] oxygen (O) and hydrogen (H)[]
how do you write 28.048 in expanded form
omg this is the last one dankuch and many others that helped me thank you im gratefull