Deck 5: Functions and an Introduction to Recursion

ملء الشاشة (f)
exit full mode
سؤال
The argument list of a function call must match, or be consistent with, the parameter list of the called function in all of the following details, except:

A) The number of arguments/parameters in the list.
B) The types of arguments/parameters in the list.
C) The names of arguments/parameters in the list.
D) The argument list and parameter list must match in all of the above details.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
Functions can:

A) Be used as building blocks to create new programs.
B) Return a result to the caller function.
C) Be reused any number of times.
D) Do all of the above.
سؤال
Which of the following is not a valid enumeration statement?

A) Enum person { me, you, them };.
B) Enum person { me = 1, you = 2, them = 3 };.
C) Enum person { me = 0, you = 0, them = 0 };.
D) Enum person { me, you, me };.
سؤال
Enumeration constants:

A) Must have unique integer values.
B) Can be assigned other values once they've been defined.
C) Must have unique identifiers.
D) Are declared using the keyword const.
سؤال
The function prototype
Double mySqrt int x );

A) Declares a function called mySqrt which takes an integer as an argument and returns a double.
B) Defines a function called double which calculates square roots.
C) Defines a function called mySqrt which takes an argument of type x and returns a double.
D) Declares a function called mySqrt which takes a double as an argument and returns an integer.
سؤال
Srand:

A) Should be called before each call to rand.
B) Should be used instead of rand to generate truly random numbers.
C) Is unnecessary in C++.
D) Can use the time function's return value as an optimal seed value.
سؤال
An identifier's storage class:

A) Determines whether an identifier is known only in the current source file or in any source file with proper declarations.
B) Determines the period during which that identifier exists in memory.
C) Determines where the identifier can be referenced in a program.
D) All of the above.
سؤال
Which of the following expressions returns the trigonometric sine of x?

A) sin x ).
B) sine x ).
C) trig_sin x ).
D) trig_sine x ).
سؤال
Each standard library has a corresponding:

A) Function.
B) Variable type.
C) Header file.
D) CD-ROM.
سؤال
Using the following function definition, the parameter list is represented by:
A B C )
{
D
}

A) A.
B) B.
C) C.
D) D.
سؤال
Converting from type ________ to type ________ will result in the loss of data.

A) bool, char.
B) float, double.
C) int, char.
D) short, long.
سؤال
All of the following are true of functions except:

A) They define specific tasks that can be used at many points in a program.
B) A function call must specify the name and arguments of the function.
C) The definition of a function usually is visible to other functions.
D) The implementation of a function is hidden from the caller.
سؤال
In the expression
N = x + rand) % y;

A) y is the shifting value.
B) x is the scaling value.
C) y is the scaling value.
D) Both a) and b).
سؤال
Which of the following C++ Standard Library header files does not contain a C++ Standard Library container class?

A) .
B) .
C) .
D) .
سؤال
A variable that can have values only in the range 0 to 65535 is a:

A) Four-byte int.
B) Four-byte unsigned int.
C) Two-byte int.
D) Two-byte unsigned int.
سؤال
A function prototype can always be omitted when:

A) A function is defined before it's first invoked.
B) A function is invoked before it's first defined.
C) A function takes no arguments.
D) A function does not return a value.
سؤال
A function prototype does not have to:

A) Include parameter names.
B) Terminate with a semicolon.
C) Agree with the function definition.
D) Match with all calls to the function.
سؤال
The rand function generates a data value of the type:

A) unsigned int.
B) int.
C) long int.
D) short int.
سؤال
Which of the following statements is false?

A) The commas used to separate the arguments in a function call are comma operators.
B) The comma operator guarantees that its operands are evaluated left to right.
C) The order of evaluation of a function's arguments is not specified by the C++ standard.
D) The C++ standard guarantees that all arguments in a function call are evaluated before the called function executes.
سؤال
Which of the following is not included in ?

A) pow.
B) floor.
C) ln.
D) log.
سؤال
Which of the following does the C++ compiler not examine in order to select the proper overloaded function to call?

A) Types and order of the arguments in the function call.
B) The number of arguments in the function call.
C) The return type of the function.
D) It examines all of the above.
سؤال
In regards to default arguments, which of the following is false?

A) When an argument is omitted in a function call, the default value of that argument is automatically inserted by the compiler and passed in the function call.
B) They must be the rightmost trailing) arguments in a function's parameter list.
C) Default values can be constants.
D) Default values cannot be global variables or function calls.
سؤال
Which of the following is true of function templates?

A) All function templates begin with the keyword class.
B) Every formal type parameter is preceded by either keyword typename or template.
C) Formal type parameters act as placeholders for built-in types or user-defined types and are used to specify the types of arguments to the function, to specify the return type of the function, and to declare variables within the body of the function definition.
D) A programmer must define a separate function template for each template function specialization to be used in the program.
سؤال
What happens when two blocks, one nested inside of the other, both declare variables with the same identifier? Assume that the outer block declares its variable before the opening left-brace of the inner block.)

A) A syntax error occurs.
B) The "outer" variable is hidden while the "inner" variable is in scope.
C) The "outer" variable is irretrievably lost when the "inner" variable is declared.
D) The "inner" declaration is ignored and the "outer" variable has scope even inside the inner block.
سؤال
Overloaded functions must have:

A) Different parameter lists.
B) Different return types.
C) The same number of parameters.
D) The same number of default arguments.
سؤال
The inline keyword:

A) Increases function-call overhead.
B) Can reduce a function's execution time but increase program size.
C) Can decrease program size but increase the function's execution time.
D) Should be used with all frequently used functions.
سؤال
Call-by-reference can achieve the security of call-by-value when:

A) The value being passed is small.
B) A large argument is passed in order to improve performance.
C) A pointer to the argument is used.
D) The const qualifier is used.
سؤال
If the function int volume int x = 1, int y = 1, int z = 1 ); is called by the expression volume 3 ), how many default arguments are used?

A) None.
B) One.
C) Two.
D) Three.
سؤال
Which of the following is not included in a function's activation record?

A) The return address of its caller function.
B) Parameter values received from its caller.
C) Local variables it has declared.
D) The name of the function.
سؤال
Type-safe linkage is ensured by:

A) Name mangling.
B) Calling the correct function.
C) The agreement of the arguments and parameters.
D) Specifying return types.
سؤال
Given the following function template
Template < class T >
T maximum T value1, T value2 )
{
If value1 > value2 )
Return value1;
Else
Return value2;
}
What would be returned by the following two function calls?
Maximum 2, 5 );
Maximum 2.3, 5.2 );

A) 5 and a type-mismatch error.
B) 5 and 5.2.
C) 2 and 2.3.
D) Two error messages.
سؤال
Depending on the circumstances, the compiler may ignore the storage class specifier:

A) auto.
B) register.
C) static.
D) extern.
سؤال
When an argument is passed-by-value, changes in the called function __________ affect the original variable's value; when an argument is passed call-by-reference, changes in the called function __________ affect the original variable's value.

A) Do not, do.
B) Do not, do not.
C) Do, do.
D) Do, do not.
سؤال
An activation record will be popped off the function call stack whenever:

A) A function returns control to its caller.
B) A function calls another function.
C) A function calls itself.
D) A function declares a local variable.
سؤال
Which of the following is not true of static local variables?

A) They're accessible outside of the function in which they're defined.
B) They retain their values when the function in which they're defined terminates.
C) They're initialized to zero if not explicitly initialized by the programmer.
D) They can be of type int.
سؤال
Which of the following is false about the following function prototype?
Void functionA void );

A) It does not receive any arguments.
B) It could have been written void functionA );.
C) It does not return a value.
D) It could have been written functionA void );.
سؤال
Labels are the only identifiers with:

A) Function scope.
B) File scope.
C) Block scope.
D) Function-prototype scope.
سؤال
If a set of functions have the same program logic and operations and differ only in the data types) each receives as arguments) then an) __________ should be used.

A) Overloaded function.
B) Recursive function.
C) Macro.
D) Function template.
سؤال
The unary scope resolution operator is used:

A) To access a global variable when a local variable of the same name is in scope.
B) To access any variable in an outer block when a local variable of the same name is in scope.
C) To access a global variable when it is out of scope.
D) To access a local variable with the same name as a global variable.
سؤال
A reference parameter:

A) Is an alias for its corresponding argument.
B) Is declared by following the parameter's type in the function prototype by an ampersand &).
C) Cannot be modified.
D) Both a) and b).
سؤال
Recursion is memory-intensive because:

A) Recursive functions tend to declare many local variables.
B) Previous function calls are still open when the function calls itself and the activation records of these previous calls still occupy space on the call stack.
C) Many copies of the function code are created.
D) It requires large data values.
سؤال
For which of the following operators does C++ not specify the order of evaluation of its operands?

A) +.
B) &&.
C) ,.
D) ?:.
سؤال
A recursive function is a function that:

A) Returns a double.
B) Takes 3 arguments.
C) Calls itself, directly or indirectly.
D) Is inside of another function.
سؤال
What value does function mystery return when called with a value of 4?
Int mystery int number )
{
If number <= 1 )
Return 1;
Else
Return number * mystery number - 1 );
}

A) 0.
B) 1.
C) 4.
D) 24.
سؤال
Recursion is to the base case as iteration is to what:

A) The counter.
B) A repetition structure.
C) Failure of the loop continuation test.
D) A selection structure.
سؤال
Assuming the following pseudocode for the Fibonacci series, what is the value of fibonacci 5 )?
Fibonacci 0 ) = 0
Fibonacci 1 ) = 1
Fibonacci n ) = fibonacci n - 1 ) + fibonacci n - 2 )

A) 1.
B) 3.
C) 5.
D) 7.
سؤال
All of the following are reasons to use recursion except:

A) An iterative solution is not apparent.
B) The resulting program is easier to debug.
C) It more naturally mirrors the problem.
D) It maximizes execution performance.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/47
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 5: Functions and an Introduction to Recursion
1
The argument list of a function call must match, or be consistent with, the parameter list of the called function in all of the following details, except:

A) The number of arguments/parameters in the list.
B) The types of arguments/parameters in the list.
C) The names of arguments/parameters in the list.
D) The argument list and parameter list must match in all of the above details.
C
2
Functions can:

A) Be used as building blocks to create new programs.
B) Return a result to the caller function.
C) Be reused any number of times.
D) Do all of the above.
D
3
Which of the following is not a valid enumeration statement?

A) Enum person { me, you, them };.
B) Enum person { me = 1, you = 2, them = 3 };.
C) Enum person { me = 0, you = 0, them = 0 };.
D) Enum person { me, you, me };.
D
4
Enumeration constants:

A) Must have unique integer values.
B) Can be assigned other values once they've been defined.
C) Must have unique identifiers.
D) Are declared using the keyword const.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
5
The function prototype
Double mySqrt int x );

A) Declares a function called mySqrt which takes an integer as an argument and returns a double.
B) Defines a function called double which calculates square roots.
C) Defines a function called mySqrt which takes an argument of type x and returns a double.
D) Declares a function called mySqrt which takes a double as an argument and returns an integer.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
6
Srand:

A) Should be called before each call to rand.
B) Should be used instead of rand to generate truly random numbers.
C) Is unnecessary in C++.
D) Can use the time function's return value as an optimal seed value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
7
An identifier's storage class:

A) Determines whether an identifier is known only in the current source file or in any source file with proper declarations.
B) Determines the period during which that identifier exists in memory.
C) Determines where the identifier can be referenced in a program.
D) All of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
8
Which of the following expressions returns the trigonometric sine of x?

A) sin x ).
B) sine x ).
C) trig_sin x ).
D) trig_sine x ).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
9
Each standard library has a corresponding:

A) Function.
B) Variable type.
C) Header file.
D) CD-ROM.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
10
Using the following function definition, the parameter list is represented by:
A B C )
{
D
}

A) A.
B) B.
C) C.
D) D.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
11
Converting from type ________ to type ________ will result in the loss of data.

A) bool, char.
B) float, double.
C) int, char.
D) short, long.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
12
All of the following are true of functions except:

A) They define specific tasks that can be used at many points in a program.
B) A function call must specify the name and arguments of the function.
C) The definition of a function usually is visible to other functions.
D) The implementation of a function is hidden from the caller.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
13
In the expression
N = x + rand) % y;

A) y is the shifting value.
B) x is the scaling value.
C) y is the scaling value.
D) Both a) and b).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
14
Which of the following C++ Standard Library header files does not contain a C++ Standard Library container class?

A) .
B) .
C) .
D) .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
15
A variable that can have values only in the range 0 to 65535 is a:

A) Four-byte int.
B) Four-byte unsigned int.
C) Two-byte int.
D) Two-byte unsigned int.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
16
A function prototype can always be omitted when:

A) A function is defined before it's first invoked.
B) A function is invoked before it's first defined.
C) A function takes no arguments.
D) A function does not return a value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
17
A function prototype does not have to:

A) Include parameter names.
B) Terminate with a semicolon.
C) Agree with the function definition.
D) Match with all calls to the function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
18
The rand function generates a data value of the type:

A) unsigned int.
B) int.
C) long int.
D) short int.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
19
Which of the following statements is false?

A) The commas used to separate the arguments in a function call are comma operators.
B) The comma operator guarantees that its operands are evaluated left to right.
C) The order of evaluation of a function's arguments is not specified by the C++ standard.
D) The C++ standard guarantees that all arguments in a function call are evaluated before the called function executes.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which of the following is not included in ?

A) pow.
B) floor.
C) ln.
D) log.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
21
Which of the following does the C++ compiler not examine in order to select the proper overloaded function to call?

A) Types and order of the arguments in the function call.
B) The number of arguments in the function call.
C) The return type of the function.
D) It examines all of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
22
In regards to default arguments, which of the following is false?

A) When an argument is omitted in a function call, the default value of that argument is automatically inserted by the compiler and passed in the function call.
B) They must be the rightmost trailing) arguments in a function's parameter list.
C) Default values can be constants.
D) Default values cannot be global variables or function calls.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
23
Which of the following is true of function templates?

A) All function templates begin with the keyword class.
B) Every formal type parameter is preceded by either keyword typename or template.
C) Formal type parameters act as placeholders for built-in types or user-defined types and are used to specify the types of arguments to the function, to specify the return type of the function, and to declare variables within the body of the function definition.
D) A programmer must define a separate function template for each template function specialization to be used in the program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
24
What happens when two blocks, one nested inside of the other, both declare variables with the same identifier? Assume that the outer block declares its variable before the opening left-brace of the inner block.)

A) A syntax error occurs.
B) The "outer" variable is hidden while the "inner" variable is in scope.
C) The "outer" variable is irretrievably lost when the "inner" variable is declared.
D) The "inner" declaration is ignored and the "outer" variable has scope even inside the inner block.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
25
Overloaded functions must have:

A) Different parameter lists.
B) Different return types.
C) The same number of parameters.
D) The same number of default arguments.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
26
The inline keyword:

A) Increases function-call overhead.
B) Can reduce a function's execution time but increase program size.
C) Can decrease program size but increase the function's execution time.
D) Should be used with all frequently used functions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
27
Call-by-reference can achieve the security of call-by-value when:

A) The value being passed is small.
B) A large argument is passed in order to improve performance.
C) A pointer to the argument is used.
D) The const qualifier is used.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
28
If the function int volume int x = 1, int y = 1, int z = 1 ); is called by the expression volume 3 ), how many default arguments are used?

A) None.
B) One.
C) Two.
D) Three.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
29
Which of the following is not included in a function's activation record?

A) The return address of its caller function.
B) Parameter values received from its caller.
C) Local variables it has declared.
D) The name of the function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
30
Type-safe linkage is ensured by:

A) Name mangling.
B) Calling the correct function.
C) The agreement of the arguments and parameters.
D) Specifying return types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
31
Given the following function template
Template < class T >
T maximum T value1, T value2 )
{
If value1 > value2 )
Return value1;
Else
Return value2;
}
What would be returned by the following two function calls?
Maximum 2, 5 );
Maximum 2.3, 5.2 );

A) 5 and a type-mismatch error.
B) 5 and 5.2.
C) 2 and 2.3.
D) Two error messages.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
32
Depending on the circumstances, the compiler may ignore the storage class specifier:

A) auto.
B) register.
C) static.
D) extern.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
33
When an argument is passed-by-value, changes in the called function __________ affect the original variable's value; when an argument is passed call-by-reference, changes in the called function __________ affect the original variable's value.

A) Do not, do.
B) Do not, do not.
C) Do, do.
D) Do, do not.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
34
An activation record will be popped off the function call stack whenever:

A) A function returns control to its caller.
B) A function calls another function.
C) A function calls itself.
D) A function declares a local variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
35
Which of the following is not true of static local variables?

A) They're accessible outside of the function in which they're defined.
B) They retain their values when the function in which they're defined terminates.
C) They're initialized to zero if not explicitly initialized by the programmer.
D) They can be of type int.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
36
Which of the following is false about the following function prototype?
Void functionA void );

A) It does not receive any arguments.
B) It could have been written void functionA );.
C) It does not return a value.
D) It could have been written functionA void );.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
37
Labels are the only identifiers with:

A) Function scope.
B) File scope.
C) Block scope.
D) Function-prototype scope.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
38
If a set of functions have the same program logic and operations and differ only in the data types) each receives as arguments) then an) __________ should be used.

A) Overloaded function.
B) Recursive function.
C) Macro.
D) Function template.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
39
The unary scope resolution operator is used:

A) To access a global variable when a local variable of the same name is in scope.
B) To access any variable in an outer block when a local variable of the same name is in scope.
C) To access a global variable when it is out of scope.
D) To access a local variable with the same name as a global variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
40
A reference parameter:

A) Is an alias for its corresponding argument.
B) Is declared by following the parameter's type in the function prototype by an ampersand &).
C) Cannot be modified.
D) Both a) and b).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
41
Recursion is memory-intensive because:

A) Recursive functions tend to declare many local variables.
B) Previous function calls are still open when the function calls itself and the activation records of these previous calls still occupy space on the call stack.
C) Many copies of the function code are created.
D) It requires large data values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
42
For which of the following operators does C++ not specify the order of evaluation of its operands?

A) +.
B) &&.
C) ,.
D) ?:.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
43
A recursive function is a function that:

A) Returns a double.
B) Takes 3 arguments.
C) Calls itself, directly or indirectly.
D) Is inside of another function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
44
What value does function mystery return when called with a value of 4?
Int mystery int number )
{
If number <= 1 )
Return 1;
Else
Return number * mystery number - 1 );
}

A) 0.
B) 1.
C) 4.
D) 24.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
45
Recursion is to the base case as iteration is to what:

A) The counter.
B) A repetition structure.
C) Failure of the loop continuation test.
D) A selection structure.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
46
Assuming the following pseudocode for the Fibonacci series, what is the value of fibonacci 5 )?
Fibonacci 0 ) = 0
Fibonacci 1 ) = 1
Fibonacci n ) = fibonacci n - 1 ) + fibonacci n - 2 )

A) 1.
B) 3.
C) 5.
D) 7.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
47
All of the following are reasons to use recursion except:

A) An iterative solution is not apparent.
B) The resulting program is easier to debug.
C) It more naturally mirrors the problem.
D) It maximizes execution performance.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 47 في هذه المجموعة.