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
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
+31
votes
9
answers
1
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
2 days
ago
in
DS
by
piyushwm
(
389
points)

4.4k
views
gate2004it
datastructure
linkedlists
normal
ambiguous
0
votes
1
answer
2
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
3 days
ago
in
DS
by
Satbir
Boss
(
13.2k
points)

172
views
heap
binaryheap
timecomplexity
+1
vote
1
answer
3
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
(
13.2k
points)

184
views
gate1989
descriptive
datastructure
linkedlists
+7
votes
3
answers
4
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)

754
views
gate1993
datastructure
linkedlists
normal
+14
votes
5
answers
5
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.5k
views
gate1998
datastructure
linkedlists
normal
+26
votes
7
answers
6
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.6k
views
gate2004
datastructure
linkedlists
normal
+25
votes
4
answers
7
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.5k
views
gate2008
datastructure
linkedlists
normal
0
votes
2
answers
8
Made Easy Test Series:Data StructureStack
There is given a infix expression: ${\color{Red} {1}}$ $A+B\times C/\left ( \left ( D+E \right )+F\times G \right )$ While converting infix expression to postfix expression number of symbols in the stack at indicated ... $5$, but is it correct? Can anyone give some explanation??
answered
May 31
in
DS
by
abhishekmehta4u
Boss
(
33.9k
points)

91
views
madeeasytestseries
datastructure
stack
+1
vote
0
answers
9
Allen Career Institute:Circular Queue
$1)$How circular queue can be implemented? $2)$ For which data structure circular queue cannot be implemented? $(A)$Array $(B)$ Singly Linked List $(C)$ Doubly Linked List $(D)$ Stack
asked
May 24
in
DS
by
srestha
Veteran
(
111k
points)

117
views
datastructure
circularqueue
0
votes
0
answers
10
doubly linked linked list
why we use double pointer struct Node** head here? can anyone explain with details /* Given a reference (pointer to pointer) to the head of a DLL and an int, appends a new node at the end */ void append(struct Node** head_ref, int new_data) { struct Node* ... } while (last>next != NULL) last = last>next; last>next = new_node; new_node>prev = last; return; }
asked
May 24
in
DS
by
Arun Rout
(
109
points)

39
views
linkedlists
0
votes
1
answer
11
Made Easy Test Series:Binary Trees
Consider the following function height, to which pointer to the root node of a binary tree shown below is passed Note that max(a,b) defined by #define max(a,b) (a>b)?a:b. int height(Node *root) The output of the above code will be _________________
answered
May 24
in
DS
by
Satbir
Boss
(
13.2k
points)

59
views
madeeasytestseries
binarytree
0
votes
1
answer
12
Made Easy Test Series:DS
I want longest path from root to leaf. Then which code is correct among Code1 or Code2? Code1) int tree(Struct node *root){ int a=0, b=0,c=0; if(root==NULL) return 0; if((root>left==NULL)&&(root>right==NULL)) return 1; a=1+tree(root ... )&&(root>right==NULL)) return 1; a=tree(root>left); b=tree(root>right); c=1+max(a,b); return c; }
answered
May 22
in
DS
by
Kaluti
Loyal
(
5.4k
points)

63
views
madeeasytestseries
datastructure
0
votes
0
answers
13
Made Easy Test Series: Stack Address
A stack based CPU executes the instruction. Memory location $500$ contain $0X 88$ and memory location $700$ contain $0X37$. The stack pointer is at $0X003F$ The instruction are as follows: $I_{1}:PUSH$ $500$ $I_{2}:PUSH$. $700$ ... execution of instruction. $C)$ Memory location $600$ contain $0XBF$ after execution of instruction. $D)$ Both $a)$ and $c)$
asked
May 22
in
DS
by
srestha
Veteran
(
111k
points)

26
views
madeeasytestseries
datastructure
stack
0
votes
1
answer
14
Made Easy Test Series:Binary Tree
Consider the following function with a binary tree with atleast one node: int path(struct node *x, int len){ if(x==NULL) return B; else return A; } Assume the above function is used to check the given binary tree has any path with specified length from root to ... $B$ is $(len== 1)$ which of these two option correct? Please Explain.
answered
May 22
in
DS
by
Kaluti
Loyal
(
5.4k
points)

86
views
madeeasytestseries
datastructure
0
votes
1
answer
15
Made Easy Test Series:DSBinary Tree
Consider the following function foobar(), which takes binary tree as input. int foobar(struct node *root){ if(!root) return 0; if((!root>left)&&(!root>right)) return 10; else{ int i=foobar(root>left); int j=foobar(root> ... $C)$ Sum of leaves node of binary tree. $D)$ None What return $10$ actually means?
answered
May 8
in
DS
by
Devg123
(
51
points)

31
views
madeeasytestseries
datastructure
0
votes
1
answer
16
Made Easy Test Series: Array
Consider a 2D array $A\left [ 40.........95,40........95 \right ]$ in lower triangular matrix representation. Size of each element of array is $1B.$ If the array is implemented in memory in the form of row major order and base address of the array is $1000.$, the address of $A\left [66 \right ]\left [ 50 \right ]$ will be__________ will it be 1361 or 1362?
answered
May 8
in
DS
by
Devg123
(
51
points)

29
views
datastructure
madeeasytestseries
0
votes
1
answer
17
Self Doubt on Linked List
Can somebody write the code or algorithm, how merge sort works efficiently in linked list? Is Heap sort most inefficient in Linked List Sorting? Elaborate plz
answered
May 8
in
DS
by
Devg123
(
51
points)

34
views
linkedlists
datastructure
+1
vote
3
answers
18
Made Easy Test Series:Programming and DS
Which of the following data structure is efficient to implement priority queue such as insertion ,deletion, searching? A)Linked List B)Heap C)Sorted Array D)Unsorted Array How priority queue can work more efficiently in any data structure, other than heap?
answered
May 8
in
DS
by
Devg123
(
51
points)

144
views
madeeasytestseries
programminginc
programming
+28
votes
8
answers
19
GATE2014241
Suppose a stack implementation supports an instruction $REVERSE$, which reverses the order of elements on the stack, in addition to the $PUSH$ and $POP$ instructions. Which one of the following statements is TRUE (with respect to this modified stack)? A ... $ENQUEUE$ and $DEQUEUE$ take a single instruction each.
answered
May 8
in
DS
by
ShamikBanerjee
Junior
(
835
points)

5.6k
views
gate20142
datastructure
stack
easy
0
votes
1
answer
20
MadeEasy Test Series: Programming & DS  Stack
My doubt : What should we consider ^ operator as Bitwise XOR ? or Exponentiation
answered
May 6
in
DS
by
pratekag
Active
(
2k
points)

105
views
madeeasytestseries
datastructure
stack
infixpostfix
0
votes
2
answers
21
Made Easy Test Series: DSHash Table
Consider a hash table with $N$ slots. It is given that the collision resolution technique used in chaining. Assume simple uniform hashing, what is the probability that the last $k$ slots are unfilled after the first $'r'$ insertions? $A)\left ( 1\frac{N}{k} \right )^{r}$ ... $C)\left ( 1+\frac{N}{k} \right )^{r1}$ $D)\left ( 1\frac{k}{N} \right )^{r1}$
answered
May 6
in
DS
by
Aditya_Gate_2020
(
11
points)

55
views
datastructure
madeeasytestseries
hashing
0
votes
1
answer
22
UPPCL AE 2018:53
answered
May 3
in
DS
by
Abhisek Tiwari 4
Active
(
4.5k
points)

22
views
uppcl2018
+17
votes
10
answers
23
GATE2015210
A binary tree T has $20$ leaves. The number of nodes in T having two children is ______.
answered
May 3
in
DS
by
ShamikBanerjee
Junior
(
835
points)

4.1k
views
gate20152
datastructure
binarytree
normal
numericalanswers
0
votes
1
answer
24
Made Easy Test Series: DS
A $d$ary heap is a binary heap, but instead of $2$ children, nodes have $d$ children. A $dary$ heap can be represented by $1D$ array as follows. The root is kept in $A[1]$, and it's $d$ children are kept in order in $A[2]$ through $A[d+1]$ ... $A\left [ d^{2}+d+2 \right ]$
answered
May 2
in
DS
by
Hirak
Active
(
3k
points)

60
views
madeeasytestseries
datastructure
0
votes
1
answer
25
Made Easy Test Series: Data Structure
$A)$ Rotation operation of AVL tree always preserves the inorder numbering. $B)$ If every node of BST has either $0$ or $2$ children , then searching time is $O(log n)$ Which statement is correct? Given $A)$ is correct but $B)$ is not. Plz explain how?
answered
May 2
in
DS
by
prashant jha 1
Loyal
(
5.5k
points)

31
views
datastructure
madeeasytestseries
0
votes
2
answers
26
Made Easy Test Series:DSStack and Queue
Consider a single array $A\left [ 0...........(n1) \right ]$ is used to implement two stacks. Two stacks grows from opposite end of the array. Variable $top_{1}$ and $top_{2}$ points to the location of the topmost elements in each of the stacks ... the number of elements are present in the array at any time? $A)ntop_{2}+top_{1}$ $B)n+1top_{2}+top_{1}$
answered
May 1
in
DS
by
Hirak
Active
(
3k
points)

56
views
datastructure
madeeasytestseries
0
votes
0
answers
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?
asked
Apr 30
in
DS
by
srestha
Veteran
(
111k
points)

20
views
datastructure
madeeasytestseries
0
votes
1
answer
28
IIIT PGEE 2019
Which of the following gives O(1) complexity if we want to check whether an edge exists between two given nodes in a graph? Adjacency List Adjacency Matrix Incidence Matrix None of these
answered
Apr 29
in
DS
by
pratekag
Active
(
2k
points)

106
views
iiithpgee
graphtheory
timecomplexity
+2
votes
5
answers
29
Number of nodes in heap of height 'h'
The number of nodes of height $h$ in any $n$element heap is ________. $h$ $2^{h}$ ceil $\left[\frac{n}{2^{h}}\right]$ ceil $\left[\frac{n}{2^{h+1}}\right]$ Answer is given as D, But I think it should be C. Because, even if you take height=1 then possible nodes are 3 and 2.
answered
Apr 26
in
DS
by
Hirak
Active
(
3k
points)

2.9k
views
datastructure
binarytree
binaryheap
+17
votes
8
answers
30
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).
answered
Apr 21
in
DS
by
ShamikBanerjee
Junior
(
835
points)

7.5k
views
gate20172
datastructure
queues
0
votes
0
answers
31
Assignment 2.9 (b) page no. 28 from book Classic Data Structures Second Edition by Debasis Samanta
asked
Apr 18
in
DS
by
mahi.0409
(
5
points)

27
views
datastructure
debasissamanta
0
votes
0
answers
32
Data Structures in C by Sahni  Circular Queue using Dynamic Arrays
I'm learning data structures from a book. In the topic, Circular Queue using Dynamic Array, the author has mentioned below point, Let capacity be the initial capacity of the circular queue,We must first increase the size of ... capacity elements. But how does array doubling and slide to right copy at most 2 * capacity 2 elements??
asked
Apr 14
in
DS
by
Durga Teja
(
31
points)

41
views
datastructure
queues
0
votes
0
answers
33
# Binary tree
A weight balanced tree is a binary tree in which for each node, the no. of nodes in the left sub tree is atleast half and at most twice the no. of nodes in the right sub tree. The maximum possible height of such a tree with n nodes is best described by which of the following? (a) log2 n (b) log4/3 n (c) log3 n (d) log3/2 n
[closed]
asked
Apr 13
in
DS
by
Golam Murtuza
(
163
points)

26
views
0
votes
0
answers
34
AVL Tree Balancing
here what to do first as FIZZA and IMRAN both are unbalanced than either to do RR rotation from FIZZAIMRANNAVEEN or RL rotation from IMRANNAVEENLOVELY
asked
Apr 13
in
DS
by
kd.....
Junior
(
783
points)

28
views
avltree
datastructure
tree
bst
algorithms
0
votes
3
answers
35
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
answered
Apr 2
in
DS
by
Krishnahs
(
61
points)

2.2k
views
gate2019
datastructure
heap
+13
votes
3
answers
36
GATE199912
In binary tree, a full node is defined to be a node with $2$ children. Use induction on the height of the binary tree to prove that the number of full nodes plus one is equal to the number of leaves. Draw the minheap that results from insertion of the following elements in ... initially empty minheap: $7, 6, 5, 4, 3, 2, 1$. Show the result after the deletion of the root of this heap.
answered
Mar 24
in
DS
by
abhishekmehta4u
Boss
(
33.9k
points)

1k
views
gate1999
datastructure
heap
normal
+18
votes
3
answers
37
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$
answered
Mar 23
in
DS
by
abhishekmehta4u
Boss
(
33.9k
points)

7.1k
views
gate2009
datastructure
binarysearchtree
normal
isrodec2017
+14
votes
3
answers
38
GATE200960
Consider a binary maxheap implemented using an array. What is the content of the array after two delete operations on $\left\{25,14,16,13,10,8,12\right\}$ $\left\{14,13,12,10, 8\right\}$ $\left\{14,12,13,8,10\right\}$ $\left\{14,13,8,12,10\right\}$ $\left\{14,13,12,8,10\right\}$
answered
Mar 23
in
DS
by
abhishekmehta4u
Boss
(
33.9k
points)

1.3k
views
gate2009
datastructure
heap
normal
+14
votes
3
answers
39
GATE200959
Consider a binary maxheap implemented using an array. Which one of the following array represents a binary maxheap? $\left\{25,12,16,13,10,8,14\right\}$ $\left\{25,14,13,16,10,8,12\right\}$ $\left\{25,14,16,13,10,8,12\right\}$ $\left\{25,14,12,13,10,8,16\right\}$
answered
Mar 23
in
DS
by
abhishekmehta4u
Boss
(
33.9k
points)

1.6k
views
gate2009
datastructure
heap
normal
+16
votes
2
answers
40
GATE200013
Suppose a stack implementation supports, in addition to PUSH and POP, an operation REVERSE, which reverses the order of the elements on the stack. To implement a queue using the above stack implementation, show how to implement ENQUEUE using a single operation and DEQUEUE using a sequence of $3$ ... $5 \ 2 * 3 \ 4 + 5 \ 2$ At the end of evaluation
answered
Mar 23
in
DS
by
abhishekmehta4u
Boss
(
33.9k
points)

1.4k
views
gate2000
datastructure
stack
normal
descriptive
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
IIITH Preparation and interview experience (M.Tech CSE)
My Journey To iiiTH Mtech Cse 2019
IIIT H INTERVIEW EXPERIENCE 2019
IIITH Interview Experience
Thanks GO!!
All categories
General Aptitude
1.8k
Engineering Mathematics
7.3k
Digital Logic
2.9k
Programming & DS
4.9k
Programming
3.6k
DS
1.3k
Algorithms
4.3k
Theory of Computation
6k
Compiler Design
2k
Operating System
4.2k
Databases
4.1k
CO & Architecture
3.4k
Computer Networks
4.1k
Non GATE
1.4k
Others
1.4k
Admissions
595
Exam Queries
577
Tier 1 Placement Questions
23
Job Queries
72
Projects
18
Follow @csegate
Recent questions and answers in DS
Recent Blog Comments
Sir till when i cn get my GO 2020 hardcopy. I cnt...
Wonderful experience bro! Something different...
Congrats
Delivery is not beyond July 15 for first 200...
for address change, to whom we have to mail? As I...
49,548
questions
54,169
answers
187,463
comments
71,119
users