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
All Activity
Questions
Unanswered
Tags
Categories
Users
Ask a Question
Prev
Blogs
New Blog
Exams
First time here? Checkout the
FAQ
!
x
×
Close
Use the google search bar on side panel. It searches through all previous GATE/other questions. For hardcopy of previous year questions please see
here
Recent questions and answers in DS
+47
votes
8
answers
1
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.
answered
12 hours
ago
in
DS
by
AbhayPrajapati
(
15
points)

7.6k
views
gate20171
datastructure
linkedlists
normal
0
votes
1
answer
2
gate : Heap questions
An array of integers of size n can be converted into a heap by adjusting the heaps rooted at each internal node of the complete binary tree starting at the node ⌊(n  1) /2⌋, and doing this adjustment up to the root node (root node is at index 0) in the order ⌊(n ... n) O (n log log n) O(n log n) I dont get what question meant can ny implemented on following array 1,2,3,4,5 ?
answered
5 days
ago
in
DS
by
gorya506
(
163
points)

188
views
0
votes
1
answer
3
Can one describe it in easy meaning ?
An algorithm performs (log N)1/2 find operations , N insert operations, (log N)1/2 delete operations, and (log N)1/2 decreasekey operations on a set of data items with keys drawn from a linearly ordered set . For ... to achieve the best total asymptotic complexity considering all the operations? Unsorted array Min  heap Sorted array Sorted doubly linked list
answered
5 days
ago
in
DS
by
gorya506
(
163
points)

31
views
+2
votes
3
answers
4
data structure
answered
5 days
ago
in
DS
by
gorya506
(
163
points)

95
views
+34
votes
6
answers
5
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)$
answered
5 days
ago
in
DS
by
iarnav
Loyal
(
8k
points)

8.1k
views
gate2003
datastructure
heap
+1
vote
1
answer
6
Complexity
What is the time complexity of adding an element at the front of a circular linked list ? O(n) or theta(n) ? How to find whether it is O or theta ?
answered
5 days
ago
in
DS
by
gorya506
(
163
points)

44
views
+1
vote
2
answers
7
MadeEasy Subject Test: Programming & DS  Trees
A 4ary tree,i.e. each node has either 0 or 4 children tree has 20 leaf nodes. Then the total number of nodes in the tree are ____.
answered
5 days
ago
in
DS
by
gorya506
(
163
points)

82
views
madeeasytestseries
datastructure
trees
+1
vote
1
answer
8
AVL Tree
Suppose we have an AVL tree of n nodes and any change in the tree violates the AVL tree property then : S1: If we insert an element in the tree, maximum 2 Rotations are required to make the Tree AVL again. S2: If we delete an element from the tree, maximum 2 Rotations are required to make tree AVL again Which are correct statements?
answered
6 days
ago
in
DS
by
gorya506
(
163
points)

93
views
avltree
datastructure
tree
0
votes
1
answer
9
Testbook Test Series: Programming & DS  Stack
A queue is implemented using two stacks S1 and S2. Initially the queue contains 1, 2, 3, 4 from front to rear. The following operations are performed in the queue: delete, insert (5), delete, Then how many total no. of push and pop operations are needed to perform ... ? a) Push: 12 Pop: 13 b) Push: 15 Pop: 16 c) Push: 11 Pop: 10 d) Push: 12 Pop: 11
answered
6 days
ago
in
DS
by
gorya506
(
163
points)

153
views
testbooktestseries
data
datastructure
stack
0
votes
1
answer
10
#DS Inserting elements into Min Heap?
The number of distinct min heap are possible with keys 1, 2, 3, 4, 5 are ________. I know, there are variance of this question for Max heap and even for Min heap, the answer won't change, but I just wanna know if my technique is right or not. ===== ... any value. > Lastly the right sub tree => 1C1 = 1 Totally  1*4C3*1*2*1 = 8. Is this approach correct?
answered
6 days
ago
in
DS
by
gorya506
(
163
points)

120
views
algorithms
binaryheap
heap
datastructure
0
votes
1
answer
11
Ace Test Series: Data Structures  Circular Linked List
answered
6 days
ago
in
DS
by
gorya506
(
163
points)

70
views
acetestseries
datastructure
linkedlists
0
votes
1
answer
12
DFSArticulation Point and Bridges
I want to find the articulation point and bridges in the above graph. Further for each vertex $v$ I want to compute $v.low=$min $\left \{ v.d, w.d \right \}$ where $v.d$=discovery time of vertex v $w.d$=discovery time of ... someone help me with the values of v.low ? Because based on v.low I will be further able to solve articulation point and bridge problem.
answered
6 days
ago
in
DS
by
gorya506
(
163
points)

51
views
graph
dfs
algorithms
0
votes
1
answer
13
madeeasy
I think it is loglogn
answered
Aug 14
in
DS
by
gorya506
(
163
points)

51
views
0
votes
2
answers
14
made easy mock
consider the min heap tree.minimum number of comparisons to required to maintain the heap property after deletion of root are according to me 3, because we just need to check b/w the 2 childs as parent will be definitely greater than both of its children! am i wrong?
answered
Aug 14
in
DS
by
gorya506
(
163
points)

27
views
+1
vote
1
answer
15
#bst tree
The number of BST possible with 6 node numbered 1,2,3,4,5 and 6 with exactly one leaf node
answered
Aug 14
in
DS
by
gorya506
(
163
points)

54
views
binarytree
0
votes
1
answer
16
NIELIT 201884
For the given nodes: $89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100$ minimum ______ number of interchanges are required to convert it into a maxheap. $3$ $4$ $5$ $6$
answered
Aug 13
in
DS
by
Shiva Sagar Rao
(
345
points)

33
views
nielit2018
heap
datastructure
+19
votes
3
answers
17
GATE19948
A rooted tree with $12$ nodes has its nodes numbered $1$ to $12$ in preorder. When the tree is traversed in postorder, the nodes are visited in the order $3, 5, 4, 2, 7, 8, 6, 10, 11, 12, 9, 1$. Reconstruct the original tree from this information, that is, find the parent of each node, and show the tree diagrammatically.
answered
Aug 11
in
DS
by
blackcloud
(
79
points)

1.7k
views
gate1994
datastructure
binarytree
normal
+32
votes
4
answers
18
TIFR2010B26
Suppose there is a balanced binary search tree with $n$ nodes, where at each node, in addition to the key, we store the number of elements in the sub tree rooted at that node. Now, given two elements $a$ and $b$, such that $a < b$, we want to find ... . $O(\log n)$ comparisons but a constant number of additions. $O(n)$ comparisons and $O(n)$ additions, using depthfirst search.
answered
Aug 11
in
DS
by
blackcloud
(
79
points)

1.9k
views
tifr2010
binarysearchtree
0
votes
1
answer
19
MadeEasy Test Series 2018: Programming & DS  Binary Tree
Consider the below code which run on any tree. Inorder traversal Postorder traversal Preorder traversal None of these
answered
Aug 1
in
DS
by
Lakshminarayana K R
(
11
points)

109
views
datastructure
binarytree
madeeasytestseries
0
votes
3
answers
20
Data Structure InOrder Predecessor
If a node in a BST has two children, then its inorder predecessor has a) No left child b) No right child c) 2 children d) no child
answered
Jul 31
in
DS
by
nachi37
(
19
points)

2.1k
views
datastructure
tree
treetraversal
+28
votes
5
answers
21
GATE2014341
Consider the pseudocode given below. The function $DoSomething()$ takes as argument a pointer to the root of an arbitrary tree represented by the $leftMostChildrightSibling$ representation. Each node of the tree is of type $treeNode$. typedef struct treeNode* treeptr; ... tree. height of the tree. number of nodes without a right sibling in the tree. number of leaf nodes in the tree
answered
Jul 30
in
DS
by
Himanshu Kashyap
Junior
(
519
points)

4.7k
views
gate20143
datastructure
trees
normal
+27
votes
3
answers
22
GATE200390
Consider the function $f$ defined below. struct item { int data; struct item * next; }; int f(struct item *p) { return ((p == NULL)  (p>next == NULL) ((p>data <= p >next > data) && f(p>next) ... decreasing order of data value the elements in the list are sorted in nonincreasing order of data value not all elements in the list have the same data value
answered
Jul 24
in
DS
by
Rishi yadav
Boss
(
10.9k
points)

3.3k
views
gate2003
datastructure
linkedlists
normal
+81
votes
7
answers
23
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$
answered
Jul 23
in
DS
by
Sambhrant Maurya
Active
(
2.4k
points)

10.8k
views
gate2007it
datastructure
binarysearchtree
normal
0
votes
2
answers
24
Row Major
An array A[10][20] starts at decimal address 1000. Each element of array occupies 1 B and array is stored in row major order. Compute address of A[5][6] just give the output.No need very big derivation
answered
Jul 20
in
DS
by
Abdul khalik
(
11
points)

279
views
datastructure
+12
votes
3
answers
25
GATE20046
Level order traversal of a rooted tree can be done by starting from the root and performing preorder traversal inorder traversal depth first search breadth first search
answered
Jul 18
in
DS
by
Rudr Pawan
(
45
points)

1.4k
views
gate2004
datastructure
trees
easy
+18
votes
3
answers
26
GATE200746
Consider the following C program segment where $CellNode$ represents a node in a binary tree: struct CellNode { struct CellNode *leftChild; int element; struct CellNode *rightChild; }; int Getvalue (struct CellNode *ptr) { int value = 0; if (ptr != NULL) { if (( ... of nodes in the tree the number of internal nodes in the tree the number of leaf nodes in the tree the height of the tree
answered
Jul 18
in
DS
by
Utkarsh Pathak
(
263
points)

1.8k
views
gate2007
datastructure
binarytree
normal
0
votes
1
answer
27
Made Easy Test Series:Data Structure
Assume a Binary Search Tree is not allowed to have duplicates, there is more than one way to delete a node in the tree when the node has two children.If we resolve the situation in favor of choosing element for replacement from ... ? If we resolve the situation in favor of choosing element for replacement from left substructure what this line exactly means?
answered
Jul 15
in
DS
by
Spandan350
(
11
points)

30
views
datastructure
madeeasytestseries
+39
votes
11
answers
28
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}$
answered
Jul 13
in
DS
by
Dharmendra Lodhi
Active
(
3.4k
points)

5.9k
views
gate1994
datastructure
arrays
normal
+25
votes
11
answers
29
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$
answered
Jul 12
in
DS
by
mrityunjay dubey
(
27
points)

5.6k
views
gate2007it
datastructure
hashing
probability
normal
+32
votes
4
answers
30
GATE2008IT77
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. Starting with the above tree, while there remains a node $v$ of degree two in the tree, add an edge ... edges will remain at the end of the process? $2 * n_1 3$ $n_2 + 2 * n_1  2$ $n_3  n_2$ $n_2+ n_1 2$
answered
Jul 6
in
DS
by
chandra sai
Active
(
1.2k
points)

3.4k
views
gate2008it
datastructure
binarytree
normal
+17
votes
2
answers
31
GATE201351
The procedure given below is required to find and replace certain characters inside an input character string supplied in array $A$. The characters to be replaced are supplied in array $oldc$, while their respective replacement characters are supplied in array $newc$. Array $A$ ... cases will be successful in exposing the flaw in this procedure? None $2$ only $3$ and $4$ only $4$ only
answered
Jul 5
in
DS
by
Vikrant Singh
Boss
(
13.4k
points)

1.1k
views
gate2013
datastructure
arrays
normal
+14
votes
4
answers
32
GATE20183
A queue is implemented using a noncircular 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' be implemented by deletion ... $\Theta(1), \Theta(1)$ $\Theta(1), \Theta(n)$ $\Theta(n), \Theta(1)$ $\Theta(n), \Theta(n)$
answered
Jul 3
in
DS
by
Vipin Tiwari
(
43
points)

3.3k
views
gate2018
algorithms
datastructure
queues
normal
linkedlists
+5
votes
1
answer
33
GATE19902viii
Match the pairs in the following questions: ...
answered
Jun 30
in
DS
by
Lakshman Patel RJIT
Boss
(
45.1k
points)

718
views
gate1990
matchthefollowing
datastructure
heap
+32
votes
9
answers
34
GATE2004IT13
Let $P$ be a singly linked list. Let $Q$ be the pointer to an intermediate node $x$ in the list. What is the worstcase time complexity of the bestknown algorithm to delete the node $x$ from the list ? $O(n)$ $O(\log^2 n)$ $O(\log n)$ $O(1)$
answered
Jun 22
in
DS
by
piyushwm
(
417
points)

4.5k
views
gate2004it
datastructure
linkedlists
normal
ambiguous
0
votes
1
answer
35
Finding the minimum element in a Heap
I was going through the heap concept and one question came into my mind what will be the best case time complexity of finding the minimum element in a max heap? Thank you:)
answered
Jun 21
in
DS
by
Satbir
Boss
(
17.2k
points)

206
views
heap
binaryheap
timecomplexity
+2
votes
1
answer
36
GATE19894xi
Provide short answers to the following questions: Express the following list in terms of a linked list structure suitable for internal representation. $(((ab)c)d((e)))$
answered
Jun 15
in
DS
by
Satbir
Boss
(
17.2k
points)

201
views
gate1989
descriptive
datastructure
linkedlists
unsolved
+7
votes
3
answers
37
GATE199313
Consider a singly linked list having $n$ nodes. The data items $d_1, d_2, \dots d_n$ are stored in these $n$ nodes. Let $X$ be a pointer to the $j^{th}$ node $(1 \leq j \leq n)$ in which $d_j$ is stored. A new data item $d$ stored in node with address ... to insert $d$ into the list to obtain a list having items $d_1, d_2, \dots, d_{j}, d,\dots, d_n$ in order without using the header.
answered
Jun 5
in
DS
by
Ashu Duklan
(
13
points)

778
views
gate1993
datastructure
linkedlists
normal
+15
votes
5
answers
38
GATE199819a
Let $p$ be a pointer as shown in the figure in a single linked list. What do the following assignment statements achieve? q: = p > next p > next:= q > next q > next:=(q > next) > next (p > next) > next:= q
answered
Jun 3
in
DS
by
maddy0101
(
141
points)

1.6k
views
gate1998
datastructure
linkedlists
normal
+26
votes
7
answers
39
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
answered
Jun 2
in
DS
by
maddy0101
(
141
points)

5.8k
views
gate2004
datastructure
linkedlists
normal
+25
votes
4
answers
40
GATE200862
The following C function takes a singlelinked 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 node { int value ... $1, 3, 2, 5, 4, 7, 6$ $2, 3, 4, 5, 6, 7, 1$
answered
Jun 2
in
DS
by
maddy0101
(
141
points)

3.6k
views
gate2008
datastructure
linkedlists
normal
To see more, click for all the
questions in this category
.
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
ISI MTECH CS 2019 INTERVIEW EXPERIENCE
IIT HYDERABAD MTECH TA INTERVIEW EXPERIENCE
How to prepare for GATE with a fulltime job??
Interview Experience at IISc
All subject Gate notes from Standard Books!!
All categories
General Aptitude
1.8k
Engineering Mathematics
7.3k
Digital Logic
2.9k
Programming and DS
4.9k
Programming
3.5k
DS
1.3k
Algorithms
4.3k
Theory of Computation
6.1k
Compiler Design
2.1k
Operating System
4.2k
Databases
4.1k
CO and Architecture
3.4k
Computer Networks
4.1k
Non GATE
1.4k
Others
1.6k
Admissions
595
Exam Queries
576
Tier 1 Placement Questions
23
Job Queries
72
Projects
17
Follow @csegate
Recent questions and answers in DS
Recent Blog Comments
Can you tell me when the stock will be back in...
received the GO books in good conditions!! thanks
Sir please update your stocks, when it will be...
Yes. Stock is over with Indiapost.
But on Amazon the stock is there and a way too...
49,845
questions
54,771
answers
189,417
comments
80,390
users