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 viewed questions in Programming and DS
46
votes
4
answers
91
GATE CSE 2005 | Question: 5
A program $P$ reads in $500$ integers in the range $[0, 100]$ representing the scores of $500$ students. It then prints the frequency of each score above $50$. What would be the best way for $P$ to store the frequencies? An array of $50$ numbers An array of $100$ numbers An array of $500$ numbers A dynamically allocated array of $550$ numbers
A program $P$ reads in $500$ integers in the range $[0, 100]$ representing the scores of $500$ students. It then prints the frequency of each score above $50$. What would...
Kathleen
20.6k
views
Kathleen
asked
Sep 22, 2014
DS
gatecse-2005
data-structures
array
easy
+
–
38
votes
5
answers
92
GATE CSE 2005 | Question: 1, ISRO2017-55
What does the following C-statement declare? int (*f) (int * ); A function that takes an integer pointer as argument and returns an integer A function that takes an integer as argument and returns an integer pointer A pointer ... pointer as argument and returns an integer A function that takes an integer pointer as argument and returns a function pointer
What does the following C-statement declare?int (*f) (int * );A function that takes an integer pointer as argument and returns an integerA function that takes an integer ...
Kathleen
20.6k
views
Kathleen
asked
Sep 22, 2014
Programming in C
gatecse-2005
programming
programming-in-c
pointers
easy
isro2017
+
–
51
votes
4
answers
93
GATE CSE 2000 | Question: 1.17, ISRO2015-79
Consider the following C declaration: struct { short x[5]; union { float y; long z; } u; )t; Assume that the objects of the type short, float and long occupy $2$ bytes, $4$ bytes and $8$ bytes, respectively. The memory requirement for variable $t$, ignoring alignment consideration, is: $22$ bytes $14$ bytes $18$ bytes $10$ bytes
Consider the following C declaration:struct { short x[5]; union { float y; long z; } u; )t;Assume that the objects of the type short, float and long occupy $2$ bytes, $4$...
Kathleen
20.6k
views
Kathleen
asked
Sep 14, 2014
Programming in C
gatecse-2000
programming
programming-in-c
easy
isro2015
union
+
–
32
votes
7
answers
94
GATE CSE 2019 | Question: 40
Consider the following statements: The smallest element in a max-heap is always at a leaf node The second largest element in a max-heap is always a child of a root node A max-heap can be constructed from a binary search tree in $\Theta(n)$ time A binary search tree ... time Which of the above statements are TRUE? I, II and III I, II and IV I, III and IV II, III and IV
Consider the following statements:The smallest element in a max-heap is always at a leaf nodeThe second largest element in a max-heap is always a child of a root nodeA ma...
Arjun
20.4k
views
Arjun
asked
Feb 7, 2019
DS
gatecse-2019
data-structures
binary-heap
2-marks
+
–
42
votes
9
answers
95
GATE CSE 2018 | Question: 2
Consider the following C program: #include<stdio.h> struct Ournode{ char x, y, z; }; int main() { struct Ournode p={'1', '0', 'a'+2}; struct Ournode *q=&p; printf("%c, %c", *((char*)q+1), *((char*)q+2)); return 0; } The output of this program is: 0, c 0, a+2 '0', 'a+2' '0', 'c'
Consider the following C program:#include<stdio.h struct Ournode{ char x, y, z; }; int main() { struct Ournode p={'1', '0', 'a'+2}; struct Ournode *q=&p; printf("%c, %c",...
gatecse
20.2k
views
gatecse
asked
Feb 14, 2018
Programming in C
gatecse-2018
programming-in-c
programming
structure
normal
1-mark
+
–
42
votes
2
answers
96
GATE CSE 2011 | Question: 22
What does the following fragment of C program print? char c[] = "GATE2011"; char *p = c; printf("%s", p + p[3] - p[1]); $\text{GATE2011}$ $\text{E2011}$ $2011$ $011$
What does the following fragment of C program print?char c[] = "GATE2011"; char *p = c; printf("%s", p + p[3] - p );$\text{GATE2011}$$\text{E2011}$$2011$$011$
go_editor
20.1k
views
go_editor
asked
Sep 29, 2014
Programming in C
gatecse-2011
programming
programming-in-c
normal
array
+
–
47
votes
11
answers
97
GATE CSE 2017 Set 1 | Question: 35
Consider the following two functions. void fun1(int n) { if(n == 0) return; printf("%d", n); fun2(n - 2); printf("%d", n); } void fun2(int n) { if(n == 0) return; printf("%d", n); ... printf("%d", n); } The output printed when $\text{fun1}(5)$ is called is $53423122233445$ $53423120112233$ $53423122132435$ $53423120213243$
Consider the following two functions.void fun1(int n) { if(n == 0) return; printf("%d", n); fun2(n - 2); printf("%d", n); } void fun2(int n) { if(n == 0) return; printf("...
Arjun
20.1k
views
Arjun
asked
Feb 14, 2017
Programming in C
gatecse-2017-set1
programming
normal
tricky
recursion
+
–
65
votes
4
answers
98
GATE CSE 2003 | Question: 63, ISRO2009-25
A data structure is required for storing a set of integers such that each of the following operations can be done in $O(\log n)$ time, where $n$ is the number of elements in the set. Deletion of the smallest element Insertion of an ... used but not a heap Both balanced binary search tree and heap can be used Neither balanced search tree nor heap can be used
A data structure is required for storing a set of integers such that each of the following operations can be done in $O(\log n)$ time, where $n$ is the number of elements...
Kathleen
20.1k
views
Kathleen
asked
Sep 17, 2014
DS
gatecse-2003
data-structures
easy
isro2009
binary-search-tree
+
–
56
votes
7
answers
99
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.6k
views
go_editor
asked
Sep 28, 2014
DS
gatecse-2014-set3
data-structures
tree
normal
+
–
3
votes
3
answers
100
UGC NET CSE | December 2014 | Part 2 | Question: 24
Consider an array $A\left[20, 10\right]$, assume $4$ words per memory cell and the base address of array $A$ is $100$. What is the address of $A\left[11, 5\right]$ ? Assume row major storage. $560$ $565$ $570$ $575$
Consider an array $A\left[20, 10\right]$, assume $4$ words per memory cell and the base address of array $A$ is $100$. What is the address of $A\left[11, 5\right]$ ? Assu...
makhdoom ghaya
19.5k
views
makhdoom ghaya
asked
Jul 21, 2016
Programming in C
ugcnetcse-dec2014-paper2
array
row-major-address-calculation
+
–
2
votes
5
answers
101
ISRO2008-76
The minimum number of fields with each node of doubly linked list is 1 2 3 4
The minimum number of fields with each node of doubly linked list is1234
ajit
19.4k
views
ajit
asked
Sep 20, 2015
DS
isro2008
data-structures
linked-list
+
–
43
votes
8
answers
102
GATE CSE 2005 | Question: 2
An Abstract Data Type (ADT) is: same as an abstract class a data type that cannot be instantiated a data type for which only the operations defined on it can be used, but none else all of the above
An Abstract Data Type (ADT) is:same as an abstract classa data type that cannot be instantiateda data type for which only the operations defined on it can be used, but no...
Kathleen
19.3k
views
Kathleen
asked
Sep 22, 2014
DS
gatecse-2005
data-structures
normal
abstract-data-type
+
–
44
votes
5
answers
103
GATE CSE 1997 | Question: 1.4
The concatenation of two lists is to be performed on $O(1)$ time. Which of the following implementations of a list should be used? Singly linked list Doubly linked list Circular doubly linked list Array implementation of list
The concatenation of two lists is to be performed on $O(1)$ time. Which of the following implementations of a list should be used?Singly linked listDoubly linked listCirc...
Kathleen
19.3k
views
Kathleen
asked
Sep 29, 2014
DS
gate1997
data-structures
linked-list
easy
+
–
75
votes
5
answers
104
GATE CSE 2007 | Question: 47
Consider the process of inserting an element into a $Max \: Heap$, where the $Max \: Heap$ is represented by an $array$. Suppose we perform a binary search on the path from the new leaf to the root to find the position for the newly inserted element, the number of $comparisons$ performed is: $\Theta(\log_2n)$ $\Theta(\log_2\log_2n)$ $\Theta(n)$ $\Theta(n\log_2n)$
Consider the process of inserting an element into a $Max \: Heap$, where the $Max \: Heap$ is represented by an $array$. Suppose we perform a binary search on the path fr...
Kathleen
19.3k
views
Kathleen
asked
Sep 21, 2014
DS
gatecse-2007
data-structures
binary-heap
normal
+
–
41
votes
5
answers
105
GATE CSE 2000 | Question: 1.11
The following C declarations: struct node { int i: float j; }; struct node *s[10]; define s to be: An array, each element of which is a pointer to a structure of type node A structure of $2$ ... $3$ fields: an integer, a float, and an array of $10$ elements An array, each element of which is a structure of type node
The following C declarations:struct node { int i: float j; }; struct node *s[10];define s to be:An array, each element of which is a pointer to a structure of type nodeA ...
Kathleen
19.2k
views
Kathleen
asked
Sep 14, 2014
Programming in C
gatecse-2000
programming
programming-in-c
easy
structure
+
–
1
votes
1
answer
106
Binary Search Tree
8. What are the worst case and average case complexities of a binary search tree? a) O(n), O(n) b) O(logn), O(logn) c) O(logn), O(n) d) O(n), O(logn)
8. What are the worst case and average case complexities of a binary search tree?a) O(n), O(n)b) O(logn), O(logn)c) O(logn), O(n)d) O(n), O(logn)
pradeepchaudhary
19.1k
views
pradeepchaudhary
asked
Aug 19, 2018
Programming in C
data-structures
binary-search-tree
binary-tree
algorithms
+
–
42
votes
4
answers
107
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.0k
views
Kathleen
asked
Sep 12, 2014
DS
gatecse-2008
data-structures
linked-list
normal
+
–
7
votes
4
answers
108
number of ordered trees
The number of possible ordered trees with 3 nodes A, B, C is: (a) 16 (b) 12 (c) 6 (d) 10 what is ordered tree alignment?
The number of possible ordered trees with 3 nodes A, B, C is:(a) 16 (b) 12 (c) 6 (d) 10 what is ordered tree alignment?
padmaja
19.0k
views
padmaja
asked
May 28, 2016
DS
tree
+
–
62
votes
4
answers
109
GATE CSE 2004 | Question: 40
Suppose each set is represented as a linked list with elements in arbitrary order. Which of the operations among $\text{union, intersection, membership, cardinality}$ will be the slowest? $\text{union}$ only $\text{intersection, membership}$ $\text{membership, cardinality}$ $\text{union, intersection}$
Suppose each set is represented as a linked list with elements in arbitrary order. Which of the operations among $\text{union, intersection, membership, cardinality}$ wil...
Kathleen
18.9k
views
Kathleen
asked
Sep 18, 2014
DS
gatecse-2004
data-structures
linked-list
normal
+
–
38
votes
7
answers
110
GATE CSE 2017 Set 1 | Question: 20
Let $T$ be a tree with $10$ vertices. The sum of the degrees of all the vertices in $T$ is ________
Let $T$ be a tree with $10$ vertices. The sum of the degrees of all the vertices in $T$ is ________
Arjun
18.7k
views
Arjun
asked
Feb 14, 2017
DS
gatecse-2017-set1
data-structures
tree
easy
numerical-answers
+
–
Page:
« prev
1
2
3
4
5
6
7
8
9
10
...
309
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register