Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage
Programming in C.
Recursion.
Filter
Recent
Hot!
Most votes
Most answers
Most views
Previous GATE
Featured
Previous GATE Questions in Programming and DS
81
votes
6
answers
271
GATE CSE 2003 | Question: 6
Let $T(n)$ be the number of different binary search trees on $n$ distinct elements. Then $T(n) = \sum_{k=1}^{n} T(k-1)T(x)$, where $x$ is $n-k+1$ $n-k$ $n-k-1$ $n-k-2$
Let $T(n)$ be the number of different binary search trees on $n$ distinct elements.Then $T(n) = \sum_{k=1}^{n} T(k-1)T(x)$, where $x$ is $n-k+1$$n-k$$n-k-1$$n-k-2$
Kathleen
22.3k
views
Kathleen
asked
Sep 16, 2014
DS
gatecse-2003
normal
binary-search-tree
+
–
72
votes
4
answers
272
GATE CSE 2003 | Question: 2
Assume the following C variable declaration: int *A[10], B[10][10]; Of the following expressions: $A[2]$ $A[2][3]$ $B[1]$ $B[2][3]$ which will not give compile-time errors if used as left hand sides of assignment statements in a C program? I, II, and IV only II, III, and IV only II and IV only IV only
Assume the following C variable declaration:int *A[10], B[10][10];Of the following expressions:$A $$A [3]$$B $$B [3]$which will not give compile-time errors if used as le...
Kathleen
29.9k
views
Kathleen
asked
Sep 16, 2014
Programming in C
gatecse-2003
programming
programming-in-c
easy
pointers
+
–
44
votes
5
answers
273
GATE CSE 2006 | Question: 10
In a binary max heap containing $n$ numbers, the smallest element can be found in time $O(n)$ $O(\log n)$ $O(\log \log n)$ $O(1)$
In a binary max heap containing $n$ numbers, the smallest element can be found in time $O(n)$ $O(\log n)$ $O(\log \log n)$ $O(1)$
Rucha Shelke
20.6k
views
Rucha Shelke
asked
Sep 16, 2014
DS
gatecse-2006
data-structures
binary-heap
easy
+
–
24
votes
2
answers
274
GATE CSE 2002 | Question: 11
The following recursive function in C is a solution to the Towers of Hanoi problem. void move(int n, char A, char B, char C) { if (......................) { move (.............................); printf("Move disk %d from pole %c to pole %c\n", n, A, C); move (.....................); } } Fill in the dotted parts of the solution.
The following recursive function in C is a solution to the Towers of Hanoi problem.void move(int n, char A, char B, char C) { if (......................) { move (...........
Kathleen
3.2k
views
Kathleen
asked
Sep 15, 2014
Programming in C
gatecse-2002
programming
recursion
descriptive
+
–
20
votes
1
answer
275
GATE CSE 2002 | Question: 6
Draw all binary trees having exactly three nodes labeled $A, B$ and $C$ on which preorder traversal gives the sequence $C, B, A$.
Draw all binary trees having exactly three nodes labeled $A, B$ and $C$ on which preorder traversal gives the sequence $C, B, A$.
Kathleen
2.5k
views
Kathleen
asked
Sep 15, 2014
DS
gatecse-2002
data-structures
binary-tree
easy
descriptive
+
–
35
votes
3
answers
276
GATE CSE 2002 | Question: 2.18
The C language is: A context free language A context sensitive language A regular language Parsable fully only by a Turing machine
The C language is:A context free languageA context sensitive languageA regular languageParsable fully only by a Turing machine
Kathleen
10.1k
views
Kathleen
asked
Sep 15, 2014
Programming in C
gatecse-2002
programming
programming-in-c
normal
+
–
101
votes
7
answers
277
GATE CSE 2002 | Question: 2.12
A weight-balanced tree is a binary tree in which for each node, the number of nodes in the left sub tree is at least half and at most twice the number of nodes in the right sub tree. The maximum possible height (number of nodes on the path from the root to the furthest ... which of the following? $\log_2 n$ $\log_{\frac{4}{3}} n$ $\log_3 n$ $\log_{\frac{3}{2}} n$
A weight-balanced tree is a binary tree in which for each node, the number of nodes in the left sub tree is at least half and at most twice the number of nodes in the rig...
Kathleen
23.1k
views
Kathleen
asked
Sep 15, 2014
DS
gatecse-2002
data-structures
binary-tree
normal
+
–
35
votes
5
answers
278
GATE CSE 2002 | Question: 2.9
The number of leaf nodes in a rooted tree of n nodes, with each node having $0$ or $3$ children is: $\frac{n}{2}$ $\frac{(n-1)}{3}$ $\frac{(n-1)}{2}$ $\frac{(2n+1)}{3}$
The number of leaf nodes in a rooted tree of n nodes, with each node having $0$ or $3$ children is:$\frac{n}{2}$$\frac{(n-1)}{3}$$\frac{(n-1)}{2}$$\frac{(2n+1)}{3}$
Kathleen
30.8k
views
Kathleen
asked
Sep 15, 2014
DS
gatecse-2002
data-structures
tree
normal
+
–
39
votes
4
answers
279
GATE CSE 2002 | Question: 2.8
Consider the following declaration of a two-dimensional array in C: char $a[100][100]$; Assuming that the main memory is byte-addressable and that the array is stored starting from memory address $0$, the address of $a [40][50]$ is: $4040$ $4050$ $5040$ $5050$
Consider the following declaration of a two-dimensional array in C:char $a[100][100]$;Assuming that the main memory is byte-addressable and that the array is stored start...
Kathleen
27.7k
views
Kathleen
asked
Sep 15, 2014
Programming in C
gatecse-2002
programming-in-c
programming
easy
+
–
13
votes
2
answers
280
GATE CSE 2002 | Question: 1.18
The results returned by function under value-result and reference parameter passing conventions Do not differ Differ in the presence of loops Differ in all cases May differ in the presence of exception
The results returned by function under value-result and reference parameter passing conventionsDo not differDiffer in the presence of loopsDiffer in all casesMay differ i...
Kathleen
8.2k
views
Kathleen
asked
Sep 15, 2014
Programming in C
gatecse-2002
programming
parameter-passing
normal
out-of-syllabus-now
+
–
40
votes
1
answer
281
GATE CSE 2002 | Question: 1.17
In the C language: At most one activation record exists between the current activation record and the activation record for the main The number of activation records between the current activation record and the activation records from the main ... record for the recursive function to be saved in a different stack before the recursive function can be called.
In the C language:At most one activation record exists between the current activation record and the activation record for the mainThe number of activation records betwee...
Kathleen
10.1k
views
Kathleen
asked
Sep 15, 2014
Programming in C
gatecse-2002
programming
programming-in-c
easy
descriptive
+
–
25
votes
6
answers
282
GATE CSE 2002 | Question: 1.5
In the worst case, the number of comparisons needed to search a single linked list of length $n$ for a given element is $\log n$ $\frac{n}{2}$ $\log_2 {n} - 1$ $n$
In the worst case, the number of comparisons needed to search a single linked list of length $n$ for a given element is$\log n$$\frac{n}{2}$$\log_2 {n} - 1$$n$
Kathleen
14.7k
views
Kathleen
asked
Sep 15, 2014
DS
gatecse-2002
easy
data-structures
linked-list
+
–
33
votes
3
answers
283
GATE CSE 2001 | Question: 14
Insert the following keys one by one into a binary search tree in the order specified.$15, 32, 20, 9, 3, 25, 12, 1$Show the final binary search tree after the insertions. Draw the binary search tree after deleting $15$ from it. Complete the statements $S1$ ... ; x = depth (t -> left); S1: ___________; S2: if (x > y) return __________; S3: else return _______; }
Insert the following keys one by one into a binary search tree in the order specified.$$15, 32, 20, 9, 3, 25, 12, 1$$Show the final binary search tree after the insertion...
Kathleen
6.8k
views
Kathleen
asked
Sep 14, 2014
DS
gatecse-2001
data-structures
binary-search-tree
normal
descriptive
+
–
31
votes
2
answers
284
GATE CSE 2001 | Question: 13
Consider the following C program: void abc(char*s) { if(s[0]=='\0')return; abc(s+1); abc(s+1); printf("%c",s[0]); } main() { abc("123"); } What will be the output of the program? If $abc(s)$ is called ... string $s$ of length $n$ characters (not counting the null ('\0') character), how many characters will be printed by $abc(s)$?
Consider the following C program:void abc(char*s) { if(s[0]=='\0')return; abc(s+1); abc(s+1); printf("%c",s[0]); } main() { abc("123"); }What will be the output of the pr...
Kathleen
11.1k
views
Kathleen
asked
Sep 14, 2014
Programming in C
gatecse-2001
programming
recursion
normal
descriptive
+
–
11
votes
2
answers
285
GATE CSE 2001 | Question: 2.19
Consider the following program Program P2 var n : int; procedure W(var x : int) begin x = x + 1; print x; end procedure D begin var n : int; n = 3; W(n); end begin \\begin P2 n=10; D; end If the language has dynamic scooping and parameters are passed by reference, what will be printed by the program? 10 11 3 None of the above
Consider the following programProgram P2 var n : int; procedure W(var x : int) begin x = x + 1; print x; end procedure D begin var n : int; n = 3; W(n); end begin \\begin...
Kathleen
7.3k
views
Kathleen
asked
Sep 14, 2014
Programming in C
gatecse-2001
programming
parameter-passing
normal
out-of-syllabus-now
+
–
62
votes
3
answers
286
GATE CSE 2001 | Question: 2.18
Consider the following three C functions: $[P1]$ int *g(void) { int x = 10; return (&x); } $[P2]$ int *g(void) { int *px; *px = 10; return px; } $[P3]$ int *g(void) { int *px; px = (int*) malloc (sizeof(int)); *px = 10; ... of the above three functions are likely to cause problems with pointers? Only $P3$ Only $P1$ and $P3$ Only $P1$ and $P2$ $P1, P2$ and $P3$
Consider the following three C functions:$[P1]$ int *g(void) { int x = 10; return (&x); }$[P2]$ int *g(void) { int *px; *px = 10; return px; }$[P3]$ int *g(void) { int *p...
Kathleen
23.9k
views
Kathleen
asked
Sep 14, 2014
Programming in C
gatecse-2001
programming
programming-in-c
normal
pointers
+
–
27
votes
4
answers
287
GATE CSE 2001 | Question: 2.17 | UGCNET-AUG2016-III: 21
What is printed by the print statements in the program $P1$ assuming call by reference parameter passing? Program P1() { x = 10; y = 3; func1(y,x,x); print x; print y; } func1(x,y,z) { y = y + 4; z = x + y + z } $\text{10, 3}$ $\text{31, 3}$ $\text{27, 7}$ None of the above
What is printed by the print statements in the program $P1$ assuming call by reference parameter passing?Program P1() { x = 10; y = 3; func1(y,x,x); print x; print y; } f...
Kathleen
12.3k
views
Kathleen
asked
Sep 14, 2014
Programming in C
gatecse-2001
programming-in-c
parameter-passing
normal
ugcnetcse-aug2016-paper3
+
–
22
votes
7
answers
288
GATE CSE 2001 | Question: 2.16
What is the minimum number of stacks of size $n$ required to implement a queue of size $n$? One Two Three Four
What is the minimum number of stacks of size $n$ required to implement a queue of size $n$?OneTwoThreeFour
Kathleen
24.1k
views
Kathleen
asked
Sep 14, 2014
DS
gatecse-2001
data-structures
easy
stack
queue
+
–
25
votes
2
answers
289
GATE CSE 2001 | Question: 1.15
Consider any array representation of an $n$ element binary heap where the elements are stored from index $1$ to index $n$ of the array. For the element stored at index $i$ of the array $(i \leq n)$, the index of the parent is $i-1$ $\lfloor \frac{i}{2} \rfloor$ $\lceil \frac{i}{2} \rceil$ $\frac{(i+1)}{2}$
Consider any array representation of an $n$ element binary heap where the elements are stored from index $1$ to index $n$ of the array. For the element stored at index $i...
Kathleen
4.9k
views
Kathleen
asked
Sep 14, 2014
DS
gatecse-2001
data-structures
binary-heap
easy
+
–
6
votes
2
answers
290
GATE CSE 2000 | Question: 18
Consider the following program is pseudo-Pascal syntax program main; var x: integer; procedure Q (z: integer); begin z := z+x; writeln(z); end; procedure P (y: integer); var x: integer; begin x := y+2; Q(x); writeln(x); ... is call-by-value and the scope rule is static scoping? the parameter passing mechanism is call-by-reference and the scope rule is dynamic scoping?
Consider the following program is pseudo-Pascal syntaxprogram main; var x: integer; procedure Q (z: integer); begin z := z+x; writeln(z); end; procedure P (y: integer);...
Kathleen
3.0k
views
Kathleen
asked
Sep 14, 2014
Programming in C
gatecse-2000
programming
parameter-passing
normal
out-of-syllabus-now
descriptive
+
–
Page:
« prev
1
...
9
10
11
12
13
14
15
16
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register