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
Recent questions tagged datastructure
Webpage for Data Structures
+1
vote
1
answer
1
CMI2019A3
Suppose that the figure to the right is a binary search tree. The letters indicate the names of the nodes, not the values that are stored. What is the predecessor node, in terms of value, of the root node $A?$ $D$ $H$ $I$ $M$
asked
Sep 13
in
DS
by
gatecse
Boss
(
16.6k
points)

37
views
cmi2019
datastructure
trees
binarysearchtree
+1
vote
1
answer
2
CMI2018B4
You are given a sorted array of $n$ elements which has been circularly shifted. For example, $\{35,42,5,12,23,26\}$ is a sorted array that has been circularly shifted by $2$ positions. Give an $O(\log n)$ time algorithm to find the largest element in a circularly shifted array. (The number of positions through which it has been shifted is unknown to you.)
asked
Sep 13
in
DS
by
gatecse
Boss
(
16.6k
points)

17
views
cmi2018
datastructure
sortedarray
circularlyshiftedarray
descriptive
+1
vote
1
answer
3
CMI2018B7
A First In First Out queue is a data structure supporting the operation Enque, Deque, Print, Enque(x) adds the item $x$ to the tail of the queue. Deque removes the element at the head of the queue and returns its value. Print prints the head of the ... reverse order. If the queue had $n$ elements to begin with, how many statements would you need to print the queue in reverse order?
asked
Sep 13
in
DS
by
gatecse
Boss
(
16.6k
points)

23
views
cmi2018
datastructure
queues
descriptive
0
votes
0
answers
4
Cormen Edition 3 Exercise 10.2 Question 8 (Page No. 241)
Explain how to implement doubly linked lists using only one pointer value $x.np$ per item instead of the usual two (next and prev). Assume that all pointer values can be interpreted as $k$bit integers, and define $x.np$ ... $INSERT$, and $DELETE$ operations on such a list. Also, show how to reverse such a list in $O(1)$ time.
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

89
views
cormen
datastructure
linkedlists
descriptive
difficult
0
votes
0
answers
5
Cormen Edition 3 Exercise 10.2 Question 7 (Page No. 241)
Give a $\Theta(n)$ time nonrecursive procedure that reverses a singly linked list of $n$ elements. The procedure should use no more than constant storage beyond that needed for the list itself.
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

33
views
cormen
datastructure
linkedlists
descriptive
0
votes
0
answers
6
Cormen Edition 3 Exercise 10.2 Question 6 (Page No. 241)
The dynamicset operation $UNION$ takes two disjoint sets $S_1$ and $S_2$ as input, and it returns a set $S=S_1 \cup S_2$ consisting of all the elements of $S_1$ and $S_2$.The sets $S_1$ and $S_2$ are usually destroyed by the operation. Show how to support $UNION$ in $O(1)$ time using a suitable list data structure.
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

14
views
cormen
datastructure
linkedlists
descriptive
0
votes
0
answers
7
Cormen Edition 3 Exercise 10.2 Question 5 (Page No. 240)
Implement the dictionary operations $INSERT$, $DELETE$, and $SEARCH$ using singly linked, circular lists. What are the running times of your procedures?
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

23
views
cormen
datastructure
linkedlists
descriptive
0
votes
0
answers
8
Cormen Edition 3 Exercise 10.2 Question 4 (Page No. 240)
LISTSEARCH’(L, k) 1 x = L.nil.next 2 while x != L.nil and x.key != k 3 x = x.next 4 return x As written, each loop iteration in the LISTSEARCH’ procedure requires two tests: one for $x\neq L.nil$ and one for $x.key\neq k$. Show how to eliminate the test for $x\neq L.nil$ in each iteration.
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

12
views
cormen
datastructure
linkedlists
descriptive
0
votes
1
answer
9
Cormen Edition 3 Exercise 10.2 Question 3 (Page No. 240)
Implement a queue by a singly linked list $L$. The operations of $ENQUEUE$ and $DEQUEUE$ should still take $O(1)$ time.
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

19
views
cormen
datastructure
linkedlists
descriptive
0
votes
0
answers
10
Cormen Edition 3 Exercise 10.2 Question 2 (Page No. 240)
Implement a stack using a singly linked list $L$. The operations $PUSH$ and $POP$ should still take $O(1)$ time.
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

12
views
cormen
datastructure
linkedlists
descriptive
0
votes
0
answers
11
Cormen Edition 3 Exercise 10.2 Question 1 (Page No. 240)
Can you implement the dynamicset operation $INSERT$ on a singly linked list in $O(1)$ time? How about $DELETE$?
asked
Jun 30
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

7
views
cormen
datastructure
linkedlists
descriptive
+1
vote
1
answer
12
Cormen Edition 3 Exercise 10.1 Question 7 (Page No. 236)
Show how to implement a stack using two queues. Analyze the running time of the stack operations.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

65
views
cormen
datastructure
stack
descriptive
0
votes
0
answers
13
Cormen Edition 3 Exercise 10.1 Question 6 (Page No. 236)
Show how to implement a queue using two stacks. Analyze the running time of the queue operations.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

19
views
cormen
datastructure
queues
descriptive
0
votes
1
answer
14
Cormen Edition 3 Exercise 10.1 Question 5 (Page No. 236)
Whereas a stack allows insertion and deletion of elements at only one end, and a queue allows insertion at one end and deletion at the other end, a deque (double ended queue) allows insertion and deletion at both ends. Write ... time procedures to insert elements into and delete elements from both ends of a deque implemented by an array.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

41
views
cormen
algorithms
datastructure
queues
descriptive
0
votes
0
answers
15
Cormen Edition 3 Exercise 10.1 Question 4 (Page No. 235)
Rewrite ENQUEUE and DEQUEUE to detect underflow and overflow of a queue.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

21
views
cormen
datastructure
queues
descriptive
0
votes
0
answers
16
Cormen Edition 3 Exercise 10.1 Question 3 (Page No. 235)
ENQUEUE(Q, x) 1 Q[Q.tail] = x 2 if Q.tail == Q.length 3 Q.tail = 1 4 else Q.tail = Q.tail + 1 DEQUEUE(Q) 1 x = Q[Q.head] 2 if Q.head == Q.length 3 Q.head = 1 4 else Q.head = Q.head + 1 5 return x illustrate the ... (Q,4),ENQUEUE(Q,1),ENQUEUE(Q,3),DEQUEUE(Q),ENQUEUE(Q,8),DEQUEUE(Q) on an initially empty queue $Q$ stored in array $Q[1...6]$.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

29
views
cormen
datastructure
queues
descriptive
0
votes
0
answers
17
Cormen Edition 3 Exercise 10.1 Question 2 (Page No. 235)
Explain how to implement two stacks in one array $A[1...n]$ in such a way that neither stack overflows unless the total number of elements in both stacks together is $n$.The $PUSH$ and $POP$ operations should run in $O(1)$ time.
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

25
views
cormen
datastructure
stack
descriptive
0
votes
1
answer
18
Cormen Edition 3 Exercise 10.1 Question 1 (Page No. 235)
STACKEMPTY(S) 1 if S.top == 0 2 return TRUE 3 else return FALSE PUSH(S , x) 1 S.top = S.top + 1 2 S[S.top] = x POP(S) 1 if STACKEMPTY(S) 2 error underflow 3 else S.top = S.top  1 4 return S[S.top + 1] illustrate the result of ... $S$ stored in array $S[1...6]$
asked
Jun 28
in
Algorithms
by
akash.dinkar12
Boss
(
41.8k
points)

38
views
cormen
datastructure
stack
descriptive
0
votes
2
answers
19
GEEKS FOR GEEKS GATE 2017 MOCK
If Kruskal’s algorithm is used for finding a minimum spanning tree of a weighted graph G with n vertices and m edges and edge weights are already given in a sorted list, then, What will be the time complexity to compute the minimum cost spanning tree given that union and find operations take amortized O(1) ? A O(m logn) B O(n) C O(m) D O(n logm)
asked
Jun 9
in
Algorithms
by
Hirak
Active
(
3.5k
points)

113
views
kruskalsalgorithm
graphalgorithms
greedyalgorithm
datastructure
+1
vote
0
answers
20
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
(
117k
points)

197
views
datastructure
circularqueue
0
votes
0
answers
21
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
(
117k
points)

88
views
madeeasytestseries
datastructure
stack
+2
votes
1
answer
22
Vani Qs Bank Algorithms
.Given an array of distinct integers A[1, 2,…n]. Find the tightest upper bound to check the existence of any index i for which A[i]=i. Ans should be O(log n) right by doing binary search ??
asked
May 21
in
Algorithms
by
Hirak
Active
(
3.5k
points)

180
views
algorithms
datastructure
arrays
searching
+1
vote
2
answers
23
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
(
117k
points)

162
views
madeeasytestseries
datastructure
stack
+4
votes
3
answers
24
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
(
117k
points)

132
views
datastructure
madeeasytestseries
hashing
0
votes
0
answers
25
Made Easy Test Series:DSArray
Consider the integer array $A\left [ 1.........100,1.......100 \right ]$ in which the elements are stored in $Z$ representation. An example of a $5\times 5$ array in $Z$ representation is shown below: If the base address of $A$ is ... $A$ is stored in Row Major Order, then the address corresponding to $A\left [ 100 \right ]\left [ 55 \right ]$ is ________________
asked
May 4
in
Programming
by
srestha
Veteran
(
117k
points)

78
views
madeeasytestseries
datastructure
0
votes
1
answer
26
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
(
117k
points)

57
views
madeeasytestseries
datastructure
0
votes
1
answer
27
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
(
117k
points)

47
views
datastructure
madeeasytestseries
0
votes
1
answer
28
Made Easy Test Series: ProgrammingRecursive and Iterative Program
$I=$Iterative Program $R=$ Recursive Program $(A)$ For every program belonging to class $I$, there is an equivalent program to class $R.$ $(B)$ Every program in $R$ uses strictly more stack space compared to equivalent program in $I.$ Among $(A)$ and $(B)$ which one is correct?
asked
May 3
in
Programming
by
srestha
Veteran
(
117k
points)

23
views
madeeasytestseries
datastructure
0
votes
1
answer
29
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
(
117k
points)

80
views
madeeasytestseries
datastructure
0
votes
1
answer
30
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
(
117k
points)

47
views
datastructure
madeeasytestseries
Page:
1
2
3
4
5
6
...
39
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
OFFICIAL GATE MOCK TEST RELEASED
IIITH: Winter Research Admissions 2019 (For Spring 2020)
TIFR and JEST exam
Minimal Deterministic Finite Automata
To be aware of fake GATE test series
Follow @csegate
Recent questions tagged datastructure
Recent Blog Comments
still it's usefull for practice purpose and...
@Satbir Its a valuable info..Thanks
It is the 2019 question paper given as a mock...
Favorite is not working for blogs.. In favorites...
Favourite option does work. But list options...
50,650
questions
56,185
answers
193,939
comments
94,693
users