What will be the output of the following C++ code?
Which of the following is the correct C++ function to read a single character from the console?
What will be the output of the following C++ code?
Comment on the following expression? c = (n) ? a : b; can be rewritten as
# include <stdio.h>
int main()
{
char str1[] = "Abekus";
char str2[] = {'A', 'b', 'e', 'k', 'u', 's'};
int n1 = sizeof(str1)/sizeof(str1[0]);
int n2 = sizeof(str2)/sizeof(str2[0]);
printf("n1 = %d, n2 = %d", n1, n2);
return 0;
}
The correct statement for a function that takes pointer to a float, a pointer to a pointer to a char and returns a pointer to a pointer to a integer is ____________
What is dynamic binding?
Consider the postfix expression 4 5 6 a b 7 8 a c, where a, b, c are operators. Operator a has higher precedence over operators b and c. Operators b and c are right-associative. Then, equivalent infix expression is
Create array memo[n + 1]
// Finding fibonacci numbers with memoization.
def f(n):
if memo[n] != -1: return memo[n]
if n == 0 or n == 1: ans = 1
else: ans = f(n - 1) + f(n - 2)
memo[n] = ans return ans
// In the main function.
Fill the memo array with all values equal to -1.
ans = f(n)
Time Complexity of this program: