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
102
votes
7
answers
31
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.5k
views
Kathleen
asked
Sep 15, 2014
DS
gatecse-2002
data-structures
binary-tree
normal
+
–
57
votes
11
answers
32
GATE IT 2006 | Question: 9
In a binary tree, the number of internal nodes of degree $1$ is $5$, and the number of internal nodes of degree $2$ is $10$. The number of leaf nodes in the binary tree is $10$ $11$ $12$ $15$
In a binary tree, the number of internal nodes of degree $1$ is $5$, and the number of internal nodes of degree $2$ is $10$. The number of leaf nodes in the binary tree i...
Ishrat Jahan
26.2k
views
Ishrat Jahan
asked
Oct 31, 2014
DS
gateit-2006
data-structures
binary-tree
normal
+
–
56
votes
5
answers
33
GATE CSE 1997 | Question: 4.7
A priority queue $Q$ is used to implement a stack that stores characters. PUSH (C) is implemented as INSERT $(Q, C, K)$ where $K$ is an appropriate integer key chosen by the implementation. POP is implemented as ... For a sequence of operations, the keys chosen are in non-increasing order non-decreasing order strictly increasing order strictly decreasing order
A priority queue $Q$ is used to implement a stack that stores characters. PUSH (C) is implemented as INSERT $(Q, C, K)$ where $K$ is an appropriate integer key chosen by ...
Kathleen
24.6k
views
Kathleen
asked
Sep 29, 2014
DS
gate1997
data-structures
stack
normal
priority-queue
+
–
55
votes
8
answers
34
GATE CSE 2004 | Question: 36
A circularly linked list is used to represent a Queue. A single variable $p$ is used to access the Queue. To which node should $p$ point such that both the operations $\text{enQueue}$ and $\text{deQueue}$ can be performed in constant time? rear node front node not possible with a single pointer node next to front
A circularly linked list is used to represent a Queue. A single variable $p$ is used to access the Queue. To which node should $p$ point such that both the operations $\t...
Kathleen
31.1k
views
Kathleen
asked
Sep 18, 2014
DS
gatecse-2004
data-structures
linked-list
normal
+
–
54
votes
9
answers
35
GATE CSE 2014 Set 2 | Question: 41
Suppose a stack implementation supports an instruction $\text{REVERSE}$, which reverses the order of elements on the stack, in addition to the $\text{PUSH}$ and $\text{POP}$ ... instruction. A queue can be implemented where both $\text{ENQUEUE}$ and $\text{DEQUEUE}$ take a single instruction each.
Suppose a stack implementation supports an instruction $\text{REVERSE}$, which reverses the order of elements on the stack, in addition to the $\text{PUSH}$ and $\text{PO...
go_editor
24.9k
views
go_editor
asked
Sep 28, 2014
DS
gatecse-2014-set2
data-structures
stack
easy
+
–
62
votes
11
answers
36
GATE CSE 2015 Set 3 | Question: 26
Consider the following C program #include<stdio.h> int main() { static int a[] = {10, 20, 30, 40, 50}; static int *p[] = {a, a+3, a+4, a+1, a+2}; int **ptr = p; ptr++; printf("%d%d", ptr-p, **ptr); } The output of the program is _______.
Consider the following C program#include<stdio.h int main() { static int a[] = {10, 20, 30, 40, 50}; static int *p[] = {a, a+3, a+4, a+1, a+2}; int ptr = p; ptr++; print...
go_editor
22.7k
views
go_editor
asked
Feb 15, 2015
Programming in C
gatecse-2015-set3
programming
programming-in-c
normal
numerical-answers
pointers
+
–
46
votes
6
answers
37
GATE CSE 2012 | Question: 35
Suppose a circular queue of capacity $(n −1)$ elements is implemented with an array of $n$ elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially, $REAR = FRONT = 0$. The conditions to detect ... : $(REAR+1) \mod n == FRONT$ full: $(FRONT+1) \mod n == REAR$ empty: $REAR == FRONT$
Suppose a circular queue of capacity $(n −1)$ elements is implemented with an array of $n$ elements. Assume that the insertion and deletion operations are carried out u...
gatecse
24.2k
views
gatecse
asked
Sep 26, 2014
DS
gatecse-2012
data-structures
queue
normal
+
–
48
votes
6
answers
38
GATE CSE 2004 | Question: 3
A single array $A[1 \ldots \text{MAXSIZE}]$ is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables $top1$ and $top2$ $(top1 < top 2)$ point to the location of the topmost element in each of the stacks. If the space is to ... $(top1 = \text{MAXSIZE} / 2)$ or $(top2 = \text{MAXSIZE})$ $top1 = top2 - 1$
A single array $A[1 \ldots \text{MAXSIZE}]$ is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables $top1$ and $top2$ $(top1 < top...
Kathleen
35.6k
views
Kathleen
asked
Sep 18, 2014
DS
gatecse-2004
data-structures
stack
easy
+
–
42
votes
12
answers
39
GATE CSE 2015 Set 3 | Question: 25
Consider a binary tree T that has $200$ leaf nodes. Then the number of nodes in T that have exactly two children are ______.
Consider a binary tree T that has $200$ leaf nodes. Then the number of nodes in T that have exactly two children are ______.
go_editor
24.4k
views
go_editor
asked
Feb 14, 2015
DS
gatecse-2015-set3
data-structures
binary-tree
normal
numerical-answers
+
–
104
votes
7
answers
40
GATE CSE 2017 Set 1 | Question: 36
Consider the C functions foo and bar given below: int foo(int val) { int x=0; while(val > 0) { x = x + foo(val--); } return val; } int bar(int val) { int x = 0; while(val > 0) { x ... in: Return of $6$ and $6$ respectively. Infinite loop and abnormal termination respectively. Abnormal termination and infinite loop respectively. Both terminating abnormally.
Consider the C functions foo and bar given below:int foo(int val) { int x=0; while(val 0) { x = x + foo(val ); } return val; }int bar(int val) { int x = 0; while(val 0)...
Arjun
25.5k
views
Arjun
asked
Feb 14, 2017
Programming in C
gatecse-2017-set1
programming-in-c
programming
normal
recursion
+
–
22
votes
7
answers
41
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.4k
views
Kathleen
asked
Sep 14, 2014
DS
gatecse-2001
data-structures
easy
stack
queue
+
–
54
votes
7
answers
42
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
23.0k
views
Kathleen
asked
Oct 9, 2014
DS
gate1996
data-structures
binary-search-tree
normal
descriptive
+
–
102
votes
9
answers
43
GATE CSE 2017 Set 1 | Question: 53
Consider the following C program. #include<stdio.h> #include<string.h> void printlength(char *s, char *t) { unsigned int c=0; int len = ((strlen(s) - strlen(t)) > c) ? strlen(s) : strlen(t); printf("%d\n", len); } ... in $string.h$ as returning a value of type $size\_t$, which is an unsigned int. The output of the program is __________ .
Consider the following C program.#include<stdio.h #include<string.h void printlength(char *s, char *t) { unsigned int c=0; int len = ((strlen(s) - strlen(t)) c) ? strlen...
srestha
25.1k
views
srestha
asked
Feb 14, 2017
Programming in C
gatecse-2017-set1
programming
programming-in-c
normal
numerical-answers
+
–
36
votes
9
answers
44
GATE CSE 2020 | Question: 16
What is the worst case time complexity of inserting $n$ elements into an empty linked list, if the linked list needs to be maintained in sorted order? $\Theta(n)$ $\Theta(n \log n)$ $\Theta ( n)^{2}$ $\Theta(1)$
What is the worst case time complexity of inserting $n$ elements into an empty linked list, if the linked list needs to be maintained in sorted order?$\Theta(n)$$\Theta(n...
Arjun
26.6k
views
Arjun
asked
Feb 12, 2020
DS
gatecse-2020
linked-list
1-mark
+
–
31
votes
8
answers
45
GATE CSE 2007 | Question: 43
A complete $n-ary$ tree is a tree in which each node has $n$ children or no children. Let $I$ be the number of internal nodes and $L$ be the number of leaves in a complete $n-ary$ tree. If $L = 41$ and $I = 10$, what is the value of $n$? $3$ $4$ $5$ $6$
A complete $n-ary$ tree is a tree in which each node has $n$ children or no children. Let $I$ be the number of internal nodes and $L$ be the number of leaves in a complet...
Kathleen
26.0k
views
Kathleen
asked
Sep 21, 2014
DS
gatecse-2007
data-structures
tree
normal
+
–
131
votes
4
answers
46
GATE CSE 2014 Set 2 | Question: 11
Suppose $n$ and $p$ are unsigned int variables in a C program. We wish to set $p$ to $^nC_3$. If $n$ is large, which one of the following statements is most likely to set $p$ correctly? $p = n * (n-1) * (n-2) / 6;$ $p = n * (n-1) / 2 * (n-2) / 3;$ $p = n * (n-1) / 3 * (n-2) / 2;$ $p = n * (n-1) * (n-2) / 6.0;$
Suppose $n$ and $p$ are unsigned int variables in a C program. We wish to set $p$ to $^nC_3$. If $n$ is large, which one of the following statements is most likely to set...
go_editor
15.7k
views
go_editor
asked
Sep 28, 2014
Programming in C
gatecse-2014-set2
programming
programming-in-c
normal
+
–
43
votes
9
answers
47
GATE CSE 2000 | Question: 1.16
Aliasing in the context of programming languages refers to multiple variables having the same memory location multiple variables having the same value multiple variables having the same identifier multiple uses of the same variable
Aliasing in the context of programming languages refers tomultiple variables having the same memory locationmultiple variables having the same valuemultiple variables hav...
Kathleen
24.8k
views
Kathleen
asked
Sep 14, 2014
Programming in C
gatecse-2000
programming
easy
aliasing
+
–
35
votes
12
answers
48
GATE CSE 2015 Set 2 | Question: 10
A binary tree T has $20$ leaves. The number of nodes in T having two children is ______.
A binary tree T has $20$ leaves. The number of nodes in T having two children is ______.
go_editor
30.5k
views
go_editor
asked
Feb 12, 2015
DS
gatecse-2015-set2
data-structures
binary-tree
normal
numerical-answers
+
–
97
votes
6
answers
49
GATE CSE 2016 Set 2 | Question: 15
$N$ items are stored in a sorted doubly linked list. For a delete operation, a pointer is provided to the record to be deleted. For a decrease-key operation, a pointer is provided to the record on which the operation is to be performed. An algorithm performs the following operations ... together? $O(\log^{2} N)$ $O(N)$ $O(N^{2})$ $\Theta\left(N^{2}\log N\right)$
$N$ items are stored in a sorted doubly linked list. For a delete operation, a pointer is provided to the record to be deleted. For a decrease-key operation, a pointer is...
Akash Kanase
34.4k
views
Akash Kanase
asked
Feb 12, 2016
DS
gatecse-2016-set2
data-structures
linked-list
time-complexity
normal
algorithms
+
–
34
votes
6
answers
50
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.7k
views
Arjun
asked
Feb 15, 2022
DS
gatecse-2022
numerical-answers
data-structures
queue
2-marks
+
–
Page:
« prev
1
2
3
4
5
6
7
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register