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
Hot questions in Programming and DS
30
votes
5
answers
81
GATE IT 2006 | Question: 45
Suppose that we have numbers between $1$ and $100$ in a binary search tree and want to search for the number $55$. Which of the following sequences CANNOT be the sequence of nodes examined? $\{10, 75, 64, 43, 60, 57, 55\}$ $\{90, 12, 68, 34, 62, 45, 55\}$ $\{9, 85, 47, 68, 43, 57, 55\}$ $\{79, 14, 72, 56, 16, 53, 55\}$
Suppose that we have numbers between $1$ and $100$ in a binary search tree and want to search for the number $55$. Which of the following sequences CANNOT be the sequence...
Ishrat Jahan
18.8k
views
Ishrat Jahan
asked
Oct 31, 2014
DS
gateit-2006
data-structures
binary-search-tree
normal
+
–
48
votes
4
answers
82
GATE CSE 2000 | Question: 2.16
Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited `in a postorder, inorder and preorder traversal respectively, of a complete binary tree. Which of the following is always true? LASTIN = LASTPOST LASTIN = LASTPRE LASTPRE = LASTPOST None of the above
Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited in a postorder, inorder and preorder traversal respectively, of a complete binary tree. Which of the foll...
Kathleen
17.7k
views
Kathleen
asked
Sep 14, 2014
DS
gatecse-2000
data-structures
binary-tree
normal
+
–
50
votes
9
answers
83
GATE CSE 2014 Set 3 | Question: 12
Consider the following rooted tree with the vertex labeled $P$ as the root: The order in which the nodes are visited during an in-order traversal of the tree is $SQPTRWUV$ $SQPTUWRV$ $SQPTWUVR$ $SQPTRUWV$
Consider the following rooted tree with the vertex labeled $P$ as the root:The order in which the nodes are visited during an in-order traversal of the tree is$SQPTRWUV$$...
go_editor
16.5k
views
go_editor
asked
Sep 28, 2014
DS
gatecse-2014-set3
data-structures
tree
easy
+
–
8
votes
2
answers
84
GATE CSE 2023 | Question: 3
Let $\textsf{SLLdel}$ be a function that deletes a node in a singly-linked list given a pointer to the node and a pointer to the head of the list. Similarly, let $\textsf{DLLdel}$ be another function that deletes a node in a doubly-linked list given a pointer to the node ... $\textsf{DLLdel}$ are $O(1)$ $\textsf{SLLdel}$ is $O(n)$ and $\textsf{DLLdel}$ is $O(1)$
Let $\textsf{SLLdel}$ be a function that deletes a node in a singly-linked list given a pointer to the node and a pointer to the head of the list. Similarly, let $\textsf...
admin
10.5k
views
admin
asked
Feb 15, 2023
DS
gatecse-2023
data-structures
linked-list
1-mark
+
–
75
votes
11
answers
85
GATE CSE 1994 | Question: 1.11
In a compact single dimensional array representation for lower triangular matrices (i.e all the elements above the diagonal are zero) of size $n \times n$, non-zero elements, (i.e elements of lower triangle) of each row are stored one after another, starting from the first row, the index of the ... is: $i+j$ $i+j-1$ $(j-1)+\frac{i(i-1)}{2}$ $i+\frac{j(j-1)}{2}$
In a compact single dimensional array representation for lower triangular matrices (i.e all the elements above the diagonal are zero) of size $n \times n$, non-zero eleme...
Kathleen
28.2k
views
Kathleen
asked
Oct 4, 2014
DS
gate1994
data-structures
array
normal
+
–
56
votes
4
answers
86
GATE CSE 2016 Set 1 | Question: 37
An operator $delete(i)$ for a binary heap data structure is to be designed to delete the item in the $i$-th node. Assume that the heap is implemented in an array and $i$ refers to the $i$-th index of the array. If the heap tree has depth $d$ (number of edges on the path from the root ... $O(d)$ but not $O(1)$ $O(2^d)$ but not $O(d)$ $O(d \ 2^d)$ but not $O(2^d)$
An operator $delete(i)$ for a binary heap data structure is to be designed to delete the item in the $i$-th node. Assume that the heap is implemented in an array and $i$...
Sandeep Singh
15.3k
views
Sandeep Singh
asked
Feb 12, 2016
DS
gatecse-2016-set1
data-structures
binary-heap
normal
+
–
42
votes
4
answers
87
GATE CSE 2008 | Question: 62
The following C function takes a single-linked list of integers as a parameter and rearranges the elements of the list. The function is called with the list containing the integers $1, 2, 3, 4, 5, 6, 7$ in the given order. What will be the contents of the list after function completes execution? struct ... $1, 3, 2, 5, 4, 7, 6$ $2, 3, 4, 5, 6, 7, 1$
The following C function takes a single-linked list of integers as a parameter and rearranges the elements of the list. The function is called with the list containing th...
Kathleen
19.2k
views
Kathleen
asked
Sep 12, 2014
DS
gatecse-2008
data-structures
linked-list
normal
+
–
31
votes
4
answers
88
GATE CSE 2005 | Question: 35
How many distinct binary search trees can be created out of $4$ distinct keys? $5$ $14$ $24$ $42$
How many distinct binary search trees can be created out of $4$ distinct keys?$5$$14$$24$$42$
Kathleen
24.5k
views
Kathleen
asked
Sep 22, 2014
DS
gatecse-2005
data-structures
binary-search-tree
counting
normal
+
–
42
votes
5
answers
89
GATE IT 2008 | Question: 76
A binary tree with $n > 1$ nodes has $n_1$, $n_2$ and $n_3$ nodes of degree one, two and three respectively. The degree of a node is defined as the number of its neighbours. $n_3$ can be expressed as $n_1 + n_2 - 1$ $n_1 -2$ $[((n_1 + n_2)/2)]$ $n_2 - 1$
A binary tree with $n 1$ nodes has $n_1$, $n_2$ and $n_3$ nodes of degree one, two and three respectively. The degree of a node is defined as the number of its neighbo...
Ishrat Jahan
16.9k
views
Ishrat Jahan
asked
Oct 29, 2014
DS
gateit-2008
data-structures
binary-tree
normal
+
–
72
votes
9
answers
90
GATE CSE 2015 Set 2 | Question: 31
A Young tableau is a $2D$ array of integers increasing from left to right and from top to bottom. Any unfilled entries are marked with $\infty$, and hence there cannot be any entry to the right of, or below a $\infty$. The following Young tableau ... The minimum number of entries (other than $1$) to be shifted, to remove $1$ from the given Young tableau is _____.
A Young tableau is a $2D$ array of integers increasing from left to right and from top to bottom. Any unfilled entries are marked with $\infty$, and hence there cannot be...
go_editor
13.2k
views
go_editor
asked
Feb 12, 2015
DS
gatecse-2015-set2
databases
array
normal
numerical-answers
+
–
59
votes
4
answers
91
GATE CSE 2014 Set 2 | Question: 40
Consider the following function. double f(double x){ if( abs(x*x - 3) < 0.01) return x; else return f(x/2 + 1.5/x); } Give a value $q$ (to $2$ decimals) such that $f(q)$ will return $q$:_____.
Consider the following function.double f(double x){ if( abs(x*x - 3) < 0.01) return x; else return f(x/2 + 1.5/x); }Give a value $q$ (to $2$ decimals) such that $f(q)$ wi...
go_editor
19.2k
views
go_editor
asked
Sep 28, 2014
Programming in C
gatecse-2014-set2
programming
recursion
numerical-answers
normal
+
–
13
votes
2
answers
92
GATE CSE 2022 | Question: 33
What is printed by the following $\text{ANSI C}$ program? #include<stdio.h> int main (int argc, char *argv[]) { int a[3][3][3] = {{1, 2, 3, 4, 5, 6, 7, 8, 9}, {10, 11, 12, 13, 14, 15, 16, 17, 18}, {19, 20, 21, 22, 23, 24, 25, 26, 27}} ... $\begin {array}{} 1 & 2 & 3 \\ 13 & 14 & 15 \\ 25 & 26 & 27 \end{array}$
What is printed by the following $\text{ANSI C}$ program?#include<stdio.h int main (int argc, char *argv[]) { int a[3][3][3] = {{1, 2, 3, 4, 5, 6, 7, 8, 9}, {10, 11, 12, ...
Arjun
8.1k
views
Arjun
asked
Feb 15, 2022
Programming in C
gatecse-2022
programming
programming-in-c
array
output
2-marks
+
–
19
votes
4
answers
93
GATE CSE 2022 | Question: 5
Consider the problem of reversing a singly linked list. To take an example, given the linked list below, the reversed linked list should look like Which one of the following statements is $\text{TRUE}$ about the time complexity of algorithms that solve the above problem ... $O(1)$ space.
Consider the problem of reversing a singly linked list. To take an example, given the linked list below,the reversed linked list should look likeWhich one of the followin...
Arjun
9.3k
views
Arjun
asked
Feb 15, 2022
DS
gatecse-2022
data-structures
linked-list
1-mark
+
–
33
votes
10
answers
94
GATE CSE 2017 Set 1 | Question: 6
Let $T$ be a binary search tree with $15$ nodes. The minimum and maximum possible heights of $T$ are: Note: The height of a tree with a single node is $0$. $4$ and $15$ respectively. $3$ and $14$ respectively. $4$ and $14$ respectively. $3$ and $15$ respectively.
Let $T$ be a binary search tree with $15$ nodes. The minimum and maximum possible heights of $T$ are:Note: The height of a tree with a single node is $0$.$4$ and $15$ res...
Arjun
16.7k
views
Arjun
asked
Feb 14, 2017
DS
gatecse-2017-set1
data-structures
binary-search-tree
easy
+
–
26
votes
4
answers
95
GATE CSE 2007 | Question: 12
The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height $h$ is: $2^h -1$ $2^{h-1} -1$ $2^{h+1} -1$ $2^{h+1}$
The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height $h$ is:$2^h -1$$2^{h-1} -1$$2^...
Kathleen
25.9k
views
Kathleen
asked
Sep 21, 2014
DS
gatecse-2007
data-structures
binary-tree
easy
+
–
5
votes
6
answers
96
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
+
–
29
votes
11
answers
97
GATE CSE 1998 | Question: 2.11
A complete $n$-ary tree is one in which every node has $0$ or $n$ sons. If $x$ is the number of internal nodes of a complete $n$-ary tree, the number of leaves in it is given by $x(n-1) +1$ $xn-1$ $xn +1$ $x(n+1)$
A complete $n$-ary tree is one in which every node has $0$ or $n$ sons. If $x$ is the number of internal nodes of a complete $n$-ary tree, the number of leaves in it is g...
Kathleen
14.7k
views
Kathleen
asked
Sep 25, 2014
DS
gate1998
data-structures
tree
normal
+
–
1
votes
2
answers
98
bubble sort
a machine took 200 sec to sort 200 names using bubble sort . in 800 sec it can approx sort how many names a)400 b)800 c)750 d)850
a machine took 200 sec to sort 200 names using bubble sort . in 800 sec it can approx sort how many namesa)400 b)800 c)750 d)850
Sanjay Sharma
18.3k
views
Sanjay Sharma
asked
May 10, 2016
68
votes
5
answers
99
GATE CSE 2017 Set 1 | Question: 55
The output of executing the following C program is _______________ . #include<stdio.h> int total(int v) { static int count = 0; while(v) { count += v&1; v >>= 1; } return count; } void main() { static int x=0; int i=5; for(; i>0; i--) { x = x + total(i); } printf("%d\n", x); }
The output of executing the following C program is _______________ .#include<stdio.h int total(int v) { static int count = 0; while(v) { count += v&1; v >>= 1; } return c...
srestha
22.4k
views
srestha
asked
Feb 14, 2017
Programming in C
gatecse-2017-set1
programming
programming-in-c
normal
numerical-answers
+
–
33
votes
4
answers
100
GATE CSE 2021 Set 1 | Question: 2
Let $P$ be an array containing $n$ integers. Let $t$ be the lowest upper bound on the number of comparisons of the array elements, required to find the minimum and maximum values in an arbitrary array of $n$ elements. Which one of the following choices is correct ... $t>\lceil \log_2(n)\rceil \text{ and } t\leq n$
Let $P$ be an array containing $n$ integers. Let $t$ be the lowest upper bound on the number of comparisons of the array elements, required to find the min...
Arjun
16.8k
views
Arjun
asked
Feb 18, 2021
DS
gatecse-2021-set1
data-structures
array
1-mark
+
–
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