Hot questions in Programming and DS

0 votes
1 answer
2521
0 votes
1 answer
2522
0 votes
2 answers
2523
0 votes
2 answers
2524
int f(int n){static int r=0;if(n<=0)return 1 ;if (n>3){r=n;return f(n-2) +2;}return f(n-1)+r;}What is the value of f(5)? Kindly explain how the recursion is working here ...
0 votes
2 answers
2526
A(n){if(n<1)return 1;elsereturn A(n-2) + B (n-1);}B(n){if(n<=1)return 1;elsereturn B(n-1) + A(n-2);}What is the output for A(6)?Please show how the recursion is working h...
0 votes
0 answers
2527
If each node of the B-tree is 80 percent full, then what is the average number of keys per node of the above B tree?
0 votes
0 answers
2528
How to identify that operator is binary or unaryc =-i j
0 votes
2 answers
2529
Consider the following nested recursive function: A(m,n)= n+1 if m=0, A(m-1,1) if n=0, A(m-1,A(m,n-1)) otherwise.What is the output of A(2,3)?
2 votes
2 answers
2530
#include <stdio.h int main(void) { int a=5, b=10; printf("%d%d",a,b); make_it(b,a,a+b); printf("%d%d",a,b); return 0; } int make_it(int x,int y, int z){ x*=y+z; y=x<<1; z...
1 votes
1 answer
2531
main (){int N, x;scanf (“%d”, & N);x = 0;while (N 0){x = x + 1 – N % 2;n/= 2;}print f(“%d,” x);}What is the sum of smallest two values of N for which value pri...
0 votes
1 answer
2534
void main{char *p;p="hello";printf("%c\n",*&*p);}
0 votes
1 answer
2535
6. Would the following program compile?main( ) { int a = 10, *j; void *k; j = k = &a; j++ ; k++; printf ("\n %u %u", j, k ) ; }Please explain above program with some exam...
0 votes
0 answers
2537
What is the output of the following program?#include<stdio.h main(){ int i = 258; int *iptr = &i; printf("%d %d",*((char*)iptr),*((char*)iptr + 1));}explain brie...
1 votes
0 answers
2540