COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
5, 4, 0, 2, 12
|
|
5, 3, 0, 2, 0
|
|
2, 0, 4, 5, 14
|
|
2, 0, 4, 5, 0
|
Detailed explanation-1: -Function f() returns an array. So var a=f() assigns an array in a . Now each array element is itself a function. So if you access any array element in the array a it will simply access the function definition but will not execute it.
Detailed explanation-2: -To return a value from a function, you must include a return statement, followed by the value to be returned, before the function’s end statement. If you do not include a return statement or if you do not specify a value after the keyword return, the value returned by the function is unpredictable.
Detailed explanation-3: -In general, a function takes arguments (if any), performs some operations, and returns a value (or object). The value that a function returns to the caller is generally known as the function’s return value. All Python functions have a return value, either explicit or implicit.
Detailed explanation-4: -A function that returns a value is called a value-returning function. A function is value-returning if the return type is anything other than void . A value-returning function must return a value of that type (using a return statement), otherwise undefined behavior will result. Related content.