The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
Facebook Login
or
Email or Username
Password
Remember
Login
Register

I forgot my password
Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Prev
Blogs
New Blog
Exams
Hot questions in DS
Recent
Hot!
Most votes
Most answers
Most views
Featured
Previous GATE
Recent
Hot!
Most votes
Most answers
Most views
Featured
Previous GATE
+93
votes
14
answers
1
GATE2016240
The number of ways in which the numbers $1, 2, 3, 4, 5, 6, 7$ can be inserted in an empty binary search tree, such that the resulting tree has height $6$, is _________. Note: The height of a tree with a single node is $0$.
asked
Feb 12, 2016
in
DS
by
Akash Kanase
Boss
(
41.9k
points)

13.8k
views
gate20162
datastructures
binarysearchtree
normal
numericalanswers
+100
votes
8
answers
2
GATE2007IT29
When searching for the key value $60$ in a binary search tree, nodes containing the key values $10, 20, 40, 50, 70, 80, 90$ are traversed, not necessarily in the order given. How many different orders are possible in which these key values can occur on the search path from the root to the node containing the value $60$? $35$ $64$ $128$ $5040$
asked
Oct 30, 2014
in
DS
by
Ishrat Jahan
Boss
(
16.3k
points)

13k
views
gate2007it
datastructures
binarysearchtree
normal
+53
votes
8
answers
3
GATE2017108
Consider the C code fragment given below. typedef struct node { int data; node* next; } node; void join(node* m, node* n) { node* p = n; while(p>next != NULL) { p = p>next; } p>next = m; } Assuming that m and n point to valid NULL ... or append list m to the end of list n. cause a null pointer dereference for all inputs. append list n to the end of list m for all inputs.
asked
Feb 14, 2017
in
DS
by
khushtak
Loyal
(
7.1k
points)

8.9k
views
gate20171
datastructures
linkedlists
normal
+74
votes
9
answers
4
GATE2016141
Let $Q$ denote a queue containing sixteen numbers and $S$ be an empty stack. $Head(Q)$ returns the element at the head of the queue $Q$ without removing it from $Q$. Similarly $Top(S)$ returns the element at the top of $S$ without removing it from $S$. ... else x:= Pop(S); Enqueue (Q, x); end end The maximum possible number of iterations of the while loop in the algorithm is _______.
asked
Feb 12, 2016
in
DS
by
Sandeep Singh
Loyal
(
7.2k
points)

10.2k
views
gate20161
datastructures
queues
difficult
numericalanswers
+20
votes
9
answers
5
GATE2017213
A circular queue has been implemented using a singly linked list where each node consists of a value and a single pointer pointing to the next node. We maintain exactly two external pointers FRONT and REAR pointing to the front node and the rear node of the queue, respectively. Which of ... node points to the front node. (I) only. (II) only. Both (I) and (II). Neither (I) nor (II).
asked
Feb 14, 2017
in
DS
by
Madhav
Active
(
1.6k
points)

8.5k
views
gate20172
datastructures
queues
+16
votes
7
answers
6
GATE201946
Let $T$ be a full binary tree with $8$ leaves. (A full binary tree has every level full.) Suppose two leaves $a$ and $b$ of $T$ are chosen uniformly and independently at random. The expected value of the distance between $a$ and $b$ in $T$ (ie., the number of edges in the unique path between $a$ and $b$) is (rounded off to $2$ decimal places) _________.
asked
Feb 7, 2019
in
DS
by
Arjun
Veteran
(
432k
points)

6.9k
views
gate2019
numericalanswers
datastructures
binarytree
+40
votes
6
answers
7
GATE200842
$G$ is a graph on $n$ vertices and $2n2$ edges. The edges of $G$ can be partitioned into two edgedisjoint spanning trees. Which of the following is NOT true for $G$? For every subset of $k$ ... are at least $2$ edgedisjoint paths between every pair of vertices. There are at least $2$ vertexdisjoint paths between every pair of vertices.
asked
Sep 27, 2014
in
DS
by
Akshay Jindal
(
385
points)

8.5k
views
gate2008
datastructures
graphs
normal
+40
votes
6
answers
8
GATE200323
In a minheap with $n$ elements with the smallest element at the root, the $7^{th}$ smallest element can be found in time $\Theta (n \log n)$ $\Theta (n)$ $\Theta(\log n)$ $\Theta(1)$
asked
Sep 19, 2014
in
DS
by
Disha
(
81
points)

9.5k
views
gate2003
datastructures
heap
+64
votes
5
answers
9
GATE200846
You are given the postorder traversal, $P$, of a binary search tree on the $n$ elements $1, 2, \dots, n$. You have to determine the unique binary search tree that has $P$ as its postorder traversal. What is the time complexity of the most efficient algorithm for doing this? $\Theta(\log n)$ $\Theta(n)$ $\Theta(n\log n)$ None of the above, as the tree cannot be uniquely determined
asked
Sep 12, 2014
in
DS
by
Kathleen
Veteran
(
52.2k
points)

11.9k
views
gate2008
datastructures
binarysearchtree
normal
+47
votes
9
answers
10
GATE201053
A hash table of length $10$ uses open addressing with hash function $h(k) = k \: mod \: 10$, and linear probing. After inserting $6$ ... sequences of the key values using the same hash function and linear probing will result in the hash table shown above? $10$ $20$ $30$ $40$
asked
Apr 21, 2016
in
DS
by
jothee
Veteran
(
106k
points)

7k
views
datastructures
hashing
normal
gate2010
+55
votes
9
answers
11
GATE2014112
Consider a rooted n node binary tree represented using pointers. The best upper bound on the time required to determine the number of subtrees having exactly $4$ nodes is $O(n^a\log^bn)$. Then the value of $a+10b$ is __________.
asked
Sep 26, 2014
in
DS
by
jothee
Veteran
(
106k
points)

6.8k
views
gate20141
datastructures
binarytree
numericalanswers
normal
+35
votes
7
answers
12
GATE2016138
Consider the weighted undirected graph with $4$ vertices, where the weight of edge $\{i,j\}$ is given by the entry $W_{ij}$ in the matrix $W$ ... possible integer value of $x$, for which at least one shortest path between some pair of vertices will contain the edge with weight $x$ is ___________.
asked
Feb 12, 2016
in
DS
by
Sandeep Singh
Loyal
(
7.2k
points)

8.5k
views
gate20161
datastructures
graphs
normal
numericalanswers
+30
votes
3
answers
13
GATE19891vii, ISRO201514
A hash table with ten buckets with one slot per bucket is shown in the following figure. The symbols $S1$ to $S7$ initially entered using a hashing function with linear probing. The maximum number of comparisons needed in searching an item that is not present is $4$ $5$ $6$ $3$
asked
Jun 1, 2015
in
DS
by
Anu
Loyal
(
5.8k
points)

7.2k
views
hashing
isro2015
gate1989
datastructures
normal
+54
votes
7
answers
14
GATE200485
A program takes as input a balanced binary search tree with $n$ leaf nodes and computes the value of a function $g(x)$ for each node $x$. If the cost of computing $g(x)$ is: $\Large \min \left ( \substack{\text{number of leafnodes}\\\text{in leftsubtree of $ ... worstcase time complexity of the program is? $\Theta (n)$ $\Theta (n \log n)$ $\Theta(n^2)$ $\Theta (n^2\log n)$
asked
Sep 19, 2014
in
DS
by
Kathleen
Veteran
(
52.2k
points)

9.3k
views
gate2004
binarysearchtree
normal
datastructures
+39
votes
5
answers
15
GATE2016236
Consider the following Neworder strategy for traversing a binary tree: Visit the root; Visit the right subtree using Neworder; Visit the left subtree using Neworder; The Neworder traversal of the expression tree corresponding to the reverse polish expression 3 4 * 5  2 ^ 6 7 * 1 +  is given by: ... $1 \ 7 \ 6 * + \ 2 \ 5 \ 4 \ 3 \ * \  \wedge $
asked
Feb 12, 2016
in
DS
by
Akash Kanase
Boss
(
41.9k
points)

5.3k
views
gate20162
datastructures
binarytree
normal
+45
votes
9
answers
16
GATE200364
Let S be a stack of size $n \geq1$. Starting with the empty stack, suppose we push the first n natural numbers in sequence, and then perform $n$ pop operations. Assume that Push and Pop operations take $X$ seconds each, and $Y$ seconds elapse between the end of one such stack operation ... from S. The average stacklife of an element of this stack is $n(X+Y)$ $3Y+2X$ $n(X+Y)X$ $Y+2X$
asked
Sep 17, 2014
in
DS
by
Kathleen
Veteran
(
52.2k
points)

7.2k
views
gate2003
datastructures
stack
normal
+50
votes
6
answers
17
GATE2016215
$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 decreasekey operation, a pointer is provided to the record on which the operation is to be performed. An algorithm performs the following operations on the list in ... put together? $O(\log^{2} N)$ $O(N)$ $O(N^{2})$ $\Theta\left(N^{2}\log N\right)$
asked
Feb 12, 2016
in
DS
by
Akash Kanase
Boss
(
41.9k
points)

11k
views
gate20162
datastructures
linkedlists
timecomplexity
normal
+21
votes
4
answers
18
GATE200937,ISRODEC201755
What is the maximum height of any AVLtree with $7$ nodes? Assume that the height of a tree with a single node is $0$. $2$ $3$ $4$ $5$
asked
Sep 22, 2014
in
DS
by
Kathleen
Veteran
(
52.2k
points)

8k
views
gate2009
datastructures
binarysearchtree
normal
isrodec2017
+46
votes
5
answers
19
GATE201344
Consider the following operation along with Enqueue and Dequeue operations on queues, where $k$ is a global parameter. MultiDequeue(Q){ m = k while (Q is not empty) and (m > 0) { Dequeue(Q) m = m – 1 } } What is the worst case time complexity of a sequence of $n$ queue operations on an initially empty queue? $Θ(n)$ $Θ(n + k)$ $Θ(nk)$ $Θ(n^2)$
asked
Aug 7, 2014
in
DS
by
gatecse
Boss
(
17.5k
points)

8.9k
views
gate2013
datastructures
algorithms
normal
queues
+42
votes
11
answers
20
GATE19941.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$ ... new representation is: $i+j$ $i+j1$ $(j1)+\frac{i(i1)}{2}$ $i+\frac{j(j1)}{2}$
asked
Oct 4, 2014
in
DS
by
Kathleen
Veteran
(
52.2k
points)

7k
views
gate1994
datastructures
arrays
normal
+37
votes
5
answers
21
GATE200363, ISRO200925
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 element if ... be used but not a heap Both balanced binary search tree and heap can be used Neither balanced search tree nor heap can be used
asked
Sep 17, 2014
in
DS
by
Kathleen
Veteran
(
52.2k
points)

5.8k
views
gate2003
datastructures
easy
isro2009
binarysearchtree
+46
votes
4
answers
22
GATE20036
Let $T(n)$ be the number of different binary search trees on $n$ distinct elements. Then $T(n) = \sum_{k=1}^{n} T(k1)T(x)$, where $x$ is $nk+1$ $nk$ $nk1$ $nk2$
asked
Sep 16, 2014
in
DS
by
Kathleen
Veteran
(
52.2k
points)

5.3k
views
gate2003
normal
binarysearchtree
+29
votes
11
answers
23
GATE2007IT28
Consider a hash function that distributes keys uniformly. The hash table size is $20$. After hashing of how many keys will the probability that any new key hashed collides with an existing one exceed $0.5$. $5$ $6$ $7$ $10$
asked
Oct 30, 2014
in
DS
by
Ishrat Jahan
Boss
(
16.3k
points)

6.8k
views
gate2007it
datastructures
hashing
probability
normal
+46
votes
8
answers
24
GATE2015231
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 consists of ... $1$) to be shifted, to remove $1$ from the given Young tableau is _____.
asked
Feb 12, 2015
in
DS
by
jothee
Veteran
(
106k
points)

3.9k
views
gate20152
databases
arrays
normal
numericalanswers
+50
votes
5
answers
25
GATE2016234
A complete binary minheap is made by including each integer in $[1, 1023]$ exactly once. The depth of a node in the heap is the length of the path from the root of the heap to that node. Thus, the root is at depth $0$. The maximum depth at which integer $9$ can appear is _________.
asked
Feb 12, 2016
in
DS
by
Akash Kanase
Boss
(
41.9k
points)

7.1k
views
gate20162
datastructures
heap
normal
numericalanswers
+3
votes
5
answers
26
GATE201940
Consider the following statements: The smallest element in a maxheap is always at a leaf node The second largest element in a maxheap is always a child of a root node A maxheap can be constructed from a binary search tree in $\theta(n)$ time A binary search tree can be ... time Which of te above statements are TRUE? I, II and III I, II and IV I, III and IV II, III and IV
asked
Feb 7, 2019
in
DS
by
Arjun
Veteran
(
432k
points)

3.1k
views
gate2019
datastructures
heap
+50
votes
6
answers
27
GATE200649
An implementation of a queue $Q$, using two stacks $S1$ and $S2$, is given below: void insert (Q, x) { push (S1, x); } void delete (Q) { if (stackempty(S2)) then if (stackempty(S1)) then { print( Q is empty ); return; } else while (!(stackempty(S1))){ x=pop(S1); push(S2 ... $2m\leq y\leq 2n $ $ 2m\leq x<2n $ and $2m\leq y\leq n+m $ $ 2m\leq x<2n $ and $2m\leq y\leq 2n $
asked
Sep 26, 2014
in
DS
by
Rucha Shelke
Active
(
3.3k
points)

7.1k
views
gate2006
datastructures
queues
stack
normal
+35
votes
3
answers
28
GATE2016110
A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of the following statements is CORRECT ($n$ refers to the number of items in the queue) ? Both operations can be performed in $O(1)$ time. At most ... for both operations will be $\Omega (n)$. Worst case time complexity for both operations will be $\Omega (\log n)$
asked
Feb 12, 2016
in
DS
by
Sandeep Singh
Loyal
(
7.2k
points)

7.6k
views
gate20161
datastructures
queues
normal
+29
votes
7
answers
29
GATE200436
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
asked
Sep 19, 2014
in
DS
by
Kathleen
Veteran
(
52.2k
points)

6.9k
views
gate2004
datastructures
linkedlists
normal
+29
votes
6
answers
30
GATE20043
A single array $A[1 .. MAXSIZE]$ is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables $top1$ and $top2$ $(top < top 2)$ point to the location of the topmost element in each of the stacks. If the space is to be used efficiently, the ... $top1 + top2 = MAXSIZE$ $(top1 = MAXSIZE / 2)$ or $(top2 = MAXSIZE)$ $top1 = top2  1$
asked
Sep 19, 2014
in
DS
by
Kathleen
Veteran
(
52.2k
points)

5.2k
views
gate2004
datastructures
stack
easy
Page:
1
2
3
4
5
6
...
45
next »
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
ISRO CSE 2020 PAPER ANALYSE
BARC OCES/DGFS 2020
ISI CMI PDF by GATE Overflow
Calculus Important Points
Management Trainee Recruitment COAL INDIA 2020
All categories
General Aptitude
1.9k
Engineering Mathematics
7.5k
Digital Logic
2.9k
Programming and DS
4.9k
Programming
3.5k
DS
1.3k
Algorithms
4.4k
Theory of Computation
6.2k
Compiler Design
2.1k
Operating System
4.5k
Databases
4.1k
CO and Architecture
3.4k
Computer Networks
4.2k
Non GATE
1.4k
Others
1.4k
Admissions
595
Exam Queries
573
Tier 1 Placement Questions
23
Job Queries
72
Projects
18
Follow @csegate
Recent Blog Comments
@devendhar, yes ....great chances of...
Cut off will be between 95115. But not more than...
@saransh0 ...... I am getting 108... is there any...
Yes you are through! Prepare for Interview
Guys do you think I have a chance? I am getting...
50,737
questions
57,391
answers
198,591
comments
105,442
users