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 in DS
Recent
Hot!
Most votes
Most answers
Most views
Featured
Previous GATE
Webpage
Arrays,
Stacks,
Queues,
Linked lists,
Trees,
Binary search trees,
Binary heaps,
Graphs.
Recent
Hot!
Most votes
Most answers
Most views
Featured
Previous GATE
+1
vote
0
answers
1
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)

108
views
datastructure
circularqueue
0
votes
0
answers
2
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
(
107
points)

39
views
linkedlists
0
votes
1
answer
3
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 _________________
asked
May 22
in
DS
by
srestha
Veteran
(
111k
points)

56
views
madeeasytestseries
binarytree
0
votes
0
answers
4
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)

21
views
madeeasytestseries
datastructure
stack
0
votes
2
answers
5
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??
asked
May 6
in
DS
by
srestha
Veteran
(
111k
points)

86
views
madeeasytestseries
datastructure
stack
0
votes
2
answers
6
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}$
asked
May 5
in
DS
by
srestha
Veteran
(
111k
points)

53
views
datastructure
madeeasytestseries
hashing
0
votes
1
answer
7
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?
asked
May 4
in
DS
by
srestha
Veteran
(
111k
points)

30
views
madeeasytestseries
datastructure
0
votes
1
answer
8
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?
asked
May 3
in
DS
by
srestha
Veteran
(
111k
points)

29
views
datastructure
madeeasytestseries
0
votes
1
answer
9
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 ]$
asked
May 2
in
DS
by
srestha
Veteran
(
111k
points)

59
views
madeeasytestseries
datastructure
0
votes
1
answer
10
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?
asked
May 2
in
DS
by
srestha
Veteran
(
111k
points)

31
views
datastructure
madeeasytestseries
0
votes
1
answer
11
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.
asked
Apr 30
in
DS
by
srestha
Veteran
(
111k
points)

83
views
madeeasytestseries
datastructure
0
votes
0
answers
12
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
13
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
asked
Apr 29
in
DS
by
srestha
Veteran
(
111k
points)

33
views
linkedlists
datastructure
0
votes
1
answer
14
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
asked
Apr 29
in
DS
by
manikgupta123
(
75
points)

105
views
iiithpgee
graphtheory
timecomplexity
0
votes
2
answers
15
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}$
asked
Apr 26
in
DS
by
srestha
Veteran
(
111k
points)

56
views
datastructure
madeeasytestseries
+1
vote
3
answers
16
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?
asked
Apr 24
in
DS
by
srestha
Veteran
(
111k
points)

143
views
madeeasytestseries
programminginc
programming
0
votes
1
answer
17
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; }
asked
Apr 22
in
DS
by
srestha
Veteran
(
111k
points)

63
views
madeeasytestseries
datastructure
0
votes
0
answers
18
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)

26
views
datastructure
debasissamanta
0
votes
0
answers
19
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)

39
views
datastructure
queues
0
votes
0
answers
20
# 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
(
133
points)

26
views
0
votes
0
answers
21
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)

27
views
avltree
datastructure
tree
bst
algorithms
0
votes
0
answers
22
Made Easy:Programming &DS
The number of possible ordered trees with 3 nodes A,B,C is ??
asked
Mar 22
in
DS
by
sandeep singh gaur
(
243
points)

54
views
tree
+1
vote
1
answer
23
Self doubt
I have a confusion regarding the array implementation of binary tree ,i.e what are the index locations of the left child of a node whether it is 2i+1 or 2i and same for right child ,can anyone explain?
asked
Mar 17
in
DS
by
Winner
(
249
points)

54
views
datastructure
0
votes
0
answers
24
JNU , DS TREE, INORDER
If inorder traversing a tree results in E A C K F H D B G, the preorder traversal would return (a) FAEKCDBHG (b) FAEKCDHGB (c) EAFKHDCBG (d) FEAKDCHBG
asked
Feb 24
in
DS
by
8676rau
(
9
points)

158
views
0
votes
0
answers
25
DataStructureDeQueue
Suppose a dequeue is stored in a circular array with N memory cells. At which of the following condition is the dequeue is full? (i) LEFT = N and RIGHT = 1 (ii) LEFT = RIGHT + 1 (iii) LEFT = 1 and RIGHT = N (iv) LEFT = RIGHT  1 + N (i) and (iii) (iii) and (iv) (ii) and (iii) (i) and (iv)
asked
Feb 24
in
DS
by
Abhisek Tiwari 4
Active
(
4.6k
points)

77
views
0
votes
0
answers
26
self doubt
somewhere we seen that formula How many binary tree possible without labeled =c(2n,n)/n+1. anybody explain how we get this formula.
asked
Feb 23
in
DS
by
sandeep singh gaur
(
243
points)

49
views
#binary
tree
0
votes
1
answer
27
ARRAY
A Sorted array of n elements contains 0 and 1 to find out majority of 0 and 1.How much time it will take??? and please explain Meaning majority of 0 and 1??
asked
Feb 19
in
DS
by
sandeep singh gaur
(
243
points)

70
views
#array
0
votes
1
answer
28
MCA ARRAY ADDRESS CALCULATION
Find the address of the position [10, 11, 12] of array A in column major order? Given Dimension is A[1:10, 5:15, 10:15], w is two word count, and Base address is 200.
asked
Feb 17
in
DS
by
SKR1997
(
5
points)

88
views
0
votes
3
answers
29
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
in
DS
by
Arjun
Veteran
(
406k
points)

2.2k
views
gate2019
datastructure
heap
+5
votes
6
answers
30
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
in
DS
by
Arjun
Veteran
(
406k
points)

4.7k
views
gate2019
numericalanswers
datastructure
binarytree
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
The day that made me an IIScian :)
Unanswered Previous year GATE/TIFR questions
From being a Failure to getting into IISc  (Rank 888, Score 692)
My interview experience at IITs/IISc
IIT Delhi CSE Mtech interview 14 may
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
2.1k
Operating System
4.2k
Databases
4.1k
CO & Architecture
3.4k
Computer Networks
4.1k
Non GATE
1.4k
Others
1.4k
Admissions
596
Exam Queries
577
Tier 1 Placement Questions
23
Job Queries
72
Projects
18
Follow @csegate
Recent questions in DS
Recent Blog Comments
@Debargh, Yes. 👍
Thanks. Regarding the probability question, was...
Thanks
What were the Eigen values of A apart from 0? I...
49,540
questions
54,099
answers
187,268
comments
71,006
users