Webpage

Programming in C. Recursion.

$$\scriptsize{\overset{{\large{\textbf{Mark Distribution in Previous GATE}}}}{\begin{array}{|c|c|c|c|c|c|c|c|}\hline
\textbf{Year} &\textbf{2024-1}&\textbf{2024-2}&\textbf{2023}& \textbf{2022}&\textbf{2021-1}&\textbf{2021-2}&\textbf{Minimum}&\textbf{Average}&\textbf{Maximum}
\\\hline\textbf{1 Mark Count} & 2&2&1&1 &0&2&0&1.33&2
\\\hline\textbf{2 Marks Count} &1&1&0& 2&2&2&0&1.33&2
\\\hline\textbf{Total Marks} &4&4&1& 5&4&6&\bf{1}&\bf{4}&\bf{6}\\\hline
\end{array}}}$$

Hot questions in Programming

#1501
232
views
1 answers
0 votes
Which method is correct for building max- heap ...why other one is wrong ??
#1502
308
views
2 answers
1 votes
Shouldn't the answer be r,7? Its given r,4.
#1503
632
views
2 answers
0 votes
To construct binary search tree either from preorder or postorder what is the efficient time complexity ?can we construct unique BST along with post and preorder ?Then wh...
#1504
1.3k
views
4 answers
1 votes
#include<stdio.h>int main(){ if(*"abc" ==*"abcdef") printf("strings are equal"); else printf("not equal"); return;}Can someone please explain this prog...
#1505
395
views
0 answers
0 votes
int main() { int i = -5; While(i<=5){ if(i>=0) break; else { i++; continue; } printf("GO"); }return 0;}
#1506
7.2k
views
1 answers
4 votes
What is the max possible height of an AVL tree with 20 nodes?a. 4b.5c.6d.7 In my opinion answer should be b.5 because height of a tree with 1 node is 0 not 1, and recurre...
#1507
826
views
1 answers
0 votes
Consider an empty binary search tree of height -1. We need to feel the following sequence of numbers in it: 11, 12, 13, 14, 15, 16, 17. The number of ways in which the nu...
#1508
347
views
2 answers
0 votes
#1509
500
views
2 answers
0 votes
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 ...
#1510
471
views
1 answers
0 votes
What will be time complexity of the program? Explain??#include<stdio.h>int main(){ int i,count=0; for(i=1 ; i<=n ; i++) { for(i=1 ; i<=$n^4$ ; i++) ...
#1511
363
views
2 answers
0 votes
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...
#1512
131
views
0 answers
0 votes
How to identify that operator is binary or unaryc =-i j
#1513
408
views
2 answers
0 votes
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)?
#1514
924
views
2 answers
2 votes
#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...
#1515
434
views
1 answers
1 votes
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...
#1516
639
views
0 answers
0 votes
que Study the following program written in a block structured language.var p, q : integer;begin p:= p+q; q:= p−q; p:= p−q;end;(a) exc...
#1517
1.4k
views
1 answers
1 votes
Q1)#include<stdio.h static int i; static int i = 27; static int i; int main() { static int i; printf("%d",i); return 0; }A) 27 B) 0 C) No Output D)None ...
#1518
482
views
1 answers
0 votes
void main{char *p;p="hello";printf("%c\n",*&*p);}
#1519
710
views
1 answers
0 votes
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...
#1520
435
views
0 answers
0 votes
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...