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
Most answered questions in Programming and DS
64
votes
7
answers
81
GATE IT 2005 | Question: 50
In a binary tree, for every node the difference between the number of nodes in the left and right subtrees is at most $2$. If the height of the tree is $h > 0$, then the minimum number of nodes in the tree is $2^{h-1}$ $2^{h-1} + 1$ $2^h - 1$ $2^h$
In a binary tree, for every node the difference between the number of nodes in the left and right subtrees is at most $2$. If the height of the tree is $h 0$, then the m...
Ishrat Jahan
22.7k
views
Ishrat Jahan
asked
Nov 3, 2014
DS
gateit-2005
data-structures
binary-tree
normal
+
–
53
votes
7
answers
82
GATE IT 2005 | Question: 12
The numbers $1, 2, .\dots n$ are inserted in a binary search tree in some order. In the resulting tree, the right subtree of the root contains $p$ nodes. The first number to be inserted in the tree must be $p$ $p + 1$ $n - p$ $n - p + 1$
The numbers $1, 2, .\dots n$ are inserted in a binary search tree in some order. In the resulting tree, the right subtree of the root contains $p$ nodes. The first number...
Ishrat Jahan
13.5k
views
Ishrat Jahan
asked
Nov 3, 2014
DS
gateit-2005
data-structures
normal
binary-search-tree
+
–
54
votes
7
answers
83
GATE CSE 1996 | Question: 4
A binary search tree is used to locate the number $43$ ...
A binary search tree is used to locate the number $43$. Which of the following probe sequences are possible and which are not? Explain.$\begin{array}{llllll} \text{(a)} ...
Kathleen
22.9k
views
Kathleen
asked
Oct 9, 2014
DS
gate1996
data-structures
binary-search-tree
normal
descriptive
+
–
49
votes
7
answers
84
GATE CSE 1995 | Question: 2.21
The postfix expression for the infix expression $A+B*(C+D)/F+D*E$ is: $AB + CD + *F/D +E*$ $ABCD + *F/DE* ++$ $A * B + CD/F *DE ++$ $A + *BCD/F* DE ++$
The postfix expression for the infix expression $A+B*(C+D)/F+D*E$ is:$AB + CD + *F/D +E*$$ABCD + *F/DE* ++$$A * B + CD/F *DE ++$$A + *BCD/F* DE ++$
Kathleen
38.3k
views
Kathleen
asked
Oct 8, 2014
DS
gate1995
data-structures
stack
easy
+
–
48
votes
7
answers
85
GATE CSE 1997 | Question: 4.5
A binary search tree contains the value $1, 2, 3, 4, 5, 6, 7, 8$. The tree is traversed in pre-order and the values are printed out. Which of the following sequences is a valid output? $5 \ 3 \ 1 \ 2 \ 4 \ 7 \ 8 \ 6$ $5 \ 3 \ 1 \ 2 \ 6 \ 4 \ 8 \ 7$ $5 \ 3 \ 2 \ 4 \ 1 \ 6 \ 7 \ 8$ $5 \ 3 \ 1 \ 2 \ 4 \ 7 \ 6 \ 8$
A binary search tree contains the value $1, 2, 3, 4, 5, 6, 7, 8$. The tree is traversed in pre-order and the values are printed out. Which of the following sequences is a...
Kathleen
37.4k
views
Kathleen
asked
Sep 29, 2014
DS
gate1997
data-structures
binary-search-tree
normal
+
–
56
votes
7
answers
86
GATE CSE 2014 Set 3 | Question: 41
Consider the pseudocode given below. The function $DoSomething()$ takes as argument a pointer to the root of an arbitrary tree represented by the $leftMostChild-rightSibling$ representation. Each node of the tree is of type $treeNode$. typedef struct ... height of the tree. number of nodes without a right sibling in the tree. number of leaf nodes in the tree
Consider the pseudocode given below. The function $DoSomething()$ takes as argument a pointer to the root of an arbitrary tree represented by the $leftMostChild-rightSibl...
go_editor
19.8k
views
go_editor
asked
Sep 28, 2014
DS
gatecse-2014-set3
data-structures
tree
normal
+
–
102
votes
7
answers
87
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.4k
views
Kathleen
asked
Sep 15, 2014
DS
gatecse-2002
data-structures
binary-tree
normal
+
–
22
votes
7
answers
88
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.3k
views
Kathleen
asked
Sep 14, 2014
DS
gatecse-2001
data-structures
easy
stack
queue
+
–
34
votes
6
answers
89
GATE CSE 2022 | Question: 52
Consider the queues $Q_{1}$ containing four elements and $Q_{2}$ containing none (shown as the $\textsf{Initial State}$ in the figure). The only operations allowed on these two queues are $\textsf{Enqueue (Q, element)}$ ... $\textsf{Final State}$ in the figure) without using any additional storage is________________.
Consider the queues $Q_{1}$ containing four elements and $Q_{2}$ containing none (shown as the $\textsf{Initial State}$ in the figure). The only operations allowed on the...
Arjun
18.5k
views
Arjun
asked
Feb 15, 2022
DS
gatecse-2022
numerical-answers
data-structures
queue
2-marks
+
–
5
votes
6
answers
90
NIELIT 2016 MAR Scientist B - Section C: 13
What error would the following function give on compilation? f(int a, int b) { int a; a=20; return a; } Missing parenthesis is $\textit{return}$ statement. Function should be defined as $\text{int f(int a, int b)}$ Redeclaration of $a$. None of these.
What error would the following function give on compilation? f(int a, int b) { int a; a=20; return a; }Missing parenthesis is $\textit{return}$ statement.Function should ...
admin
2.2k
views
admin
asked
Mar 31, 2020
Programming in C
nielit2016mar-scientistb
programming-in-c
+
–
2
votes
6
answers
91
UGC NET CSE | December 2005 | Part 2 | Question: 11
What is the output of the following $C$-program main() { printf("%d %d %d",size of (3.14f), size of (3.14), size of (3.141)); } 4 4 4 4 8 10 8 4 8 8 8 8
What is the output of the following $C$-programmain() { printf("%d %d %d",size of (3.14f), size of (3.14), size of (3.141)); }4 4 44 8 108 4 88 8 8
go_editor
2.2k
views
go_editor
asked
Mar 27, 2020
Programming in C
ugcnetcse-dec2005-paper2
programming-in-c
data-types
+
–
2
votes
6
answers
92
UGC NET CSE | January 2017 | Part 2 | Question: 24
If $h$ is chosen from a universal collection of hash functions and is used to hash $n$ keys into a table of size $m$, where $n \leq m$, the expected number of collisions involving a particular key $x$ is less than __________. $1$ $1/n$ $1/m$ $n/m$
If $h$ is chosen from a universal collection of hash functions and is used to hash $n$ keys into a table of size $m$, where $n \leq m$, the expected number of collisions ...
go_editor
2.0k
views
go_editor
asked
Mar 24, 2020
DS
ugcnetjan2017ii
cryptography
hashing
data-structures
+
–
28
votes
6
answers
93
GATE CSE 2020 | Question: 47
Consider the array representation of a binary min-heap containing $1023$ elements. The minimum number of comparisons required to find the maximum in the heap is ___________.
Consider the array representation of a binary min-heap containing $1023$ elements. The minimum number of comparisons required to find the maximum in the heap is _________...
Arjun
15.0k
views
Arjun
asked
Feb 12, 2020
DS
gatecse-2020
numerical-answers
binary-heap
2-marks
+
–
6
votes
6
answers
94
ISRO2020-18
Consider a $2$-dimensional array $x$ with $10$ rows and $4$ columns, with each element storing a value equivalent to the product of row number and column number. The array is stored in row-major format. If the first element $x[0][0]$ occupies the memory location ... , which all locations (in decimal) will be holding a value of $10$? $1018,1019$ $1022,1041$ $1013,1014$ $1000,1399$
Consider a $2$-dimensional array $x$ with $10$ rows and $4$ columns, with each element storing a value equivalent to the product of row number and column number. The arra...
Satbir
9.7k
views
Satbir
asked
Jan 13, 2020
Programming in C
isro-2020
programming
array
normal
+
–
14
votes
6
answers
95
GATE CSE 2019 | Question: 24
Consider the following C program: #include <stdio.h> int main() { int arr[]={1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 5}, *ip=arr+4; printf(“%d\n”, ip[1]); return 0; } The number that will be displayed on execution of the program is _______
Consider the following C program:#include <stdio.h int main() { int arr[]={1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 5}, *ip=arr+4; printf(“%d\n”, ip ); return 0; }The numb...
Arjun
13.6k
views
Arjun
asked
Feb 7, 2019
Programming in C
gatecse-2019
numerical-answers
programming-in-c
programming
array
easy
1-mark
+
–
5
votes
6
answers
96
ISRO2018-60
What is the output of tho following program? main(){ int x=2, y=5; if(x<y) return (x=x+y); else printf("z1"); printf("z2"); } $z2$ $z1z2$ Compilation error None of these
What is the output of tho following program?main(){ int x=2, y=5; if(x<y) return (x=x+y); else printf("z1"); printf("z2"); }$z2$$z1z2$Compilation errorNone of these
Arjun
9.9k
views
Arjun
asked
Apr 22, 2018
Programming in C
isro2018
programming
output
+
–
36
votes
6
answers
97
GATE CSE 2018 | Question: 3
A queue is implemented using a non-circular singly linked list. The queue has a head pointer and a tail pointer, as shown in the figure. Let $n$ denote the number of nodes in the queue. Let 'enqueue' be implemented by inserting a new node at the head, and 'dequeue' ... $\Theta(1), \Theta(n)$ $\Theta(n), \Theta(1)$ $\Theta(n), \Theta(n)$
A queue is implemented using a non-circular singly linked list. The queue has a head pointer and a tail pointer, as shown in the figure. Let $n$ denote the number of node...
gatecse
15.4k
views
gatecse
asked
Feb 14, 2018
DS
gatecse-2018
algorithms
data-structures
queue
normal
linked-list
1-mark
+
–
2
votes
6
answers
98
c programming
what is the o/p #include<stdio.h> void main() { int a=5; printf("%d %d %d",a++,++a,--a); } also suggest me notes so i can clear my concept about printf function (For Gate)
what is the o/p #include<stdio.h void main() { int a=5; printf("%d %d %d",a++,++a, a); }also suggest me notes so i can clear my concept about printf function (For Gate)
Nitesh Choudhary
1.1k
views
Nitesh Choudhary
asked
Jun 21, 2017
Programming in C
programming-in-c
non-gate
+
–
36
votes
6
answers
99
GATE CSE 2017 Set 2 | Question: 37
Consider the C program fragment below which is meant to divide $x$ by $y$ using repeated subtractions. The variables $x$, $y$, $q$ and $r$ are all unsigned int. while (r >= y) { r=r-y; q=q+1; } Which of the following conditions on the variables $x, y, q$ and $r$ ... $(q==0) \ \&\& \ (y>0)$
Consider the C program fragment below which is meant to divide $x$ by $y$ using repeated subtractions. The variables $x$, $y$, $q$ and $r$ are all unsigned int.while (r >...
Arjun
14.2k
views
Arjun
asked
Feb 14, 2017
Programming in C
gatecse-2017-set2
programming
loop-invariants
+
–
5
votes
6
answers
100
column major in 3d array
Consider 3 dimensional Array A[90] [30] [40] stored in linear array in column major order. If the base address starts at 10. The location of A[20] [20] [30] is __________ . [Assume the first element is stored at A[1][1][1] and each element take 1 B].
Consider 3 dimensional Array A[90] [30] [40] stored in linear array in column major order. If the base address starts at 10. The location of A[20] [20] [30] is __________...
Pankaj Joshi
15.9k
views
Pankaj Joshi
asked
Jan 26, 2017
Programming in C
array
programming-in-c
data-structures
+
–
Page:
« prev
1
2
3
4
5
6
7
8
9
10
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register