Skip to main content
added 6 characters in body
Source Link
Kilian Foth
  • 110.3k
  • 45
  • 300
  • 321

The question is ofwhether the operation would be meaningful for an empty array.

Take the function count() which returns the number of elements. That is meaningful for an empty array - the count of items would then be 0. So no need to special case the empty array. But take max() which returns the largeslargest value in an array. That is not really meaningful for an empty array. So you will have to check for that.

The question is of the operation would be meaningful for an empty array.

Take the function count() which returns the number of elements. That is meaningful for an empty array - the count of items would then be 0. So no need to special case the empty array. But take max() which returns the larges value in an array. That is not really meaningful for an empty array. So you will have to check for that.

The question is whether the operation would be meaningful for an empty array.

Take the function count() which returns the number of elements. That is meaningful for an empty array - the count of items would then be 0. So no need to special case the empty array. But take max() which returns the largest value in an array. That is not really meaningful for an empty array. So you will have to check for that.

Source Link
JacquesB
  • 61k
  • 21
  • 133
  • 187

The question is of the operation would be meaningful for an empty array.

Take the function count() which returns the number of elements. That is meaningful for an empty array - the count of items would then be 0. So no need to special case the empty array. But take max() which returns the larges value in an array. That is not really meaningful for an empty array. So you will have to check for that.