Login
Register
Dark Mode
Brightness
Ambient Glow – Questions list
Register
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged data-structures
10
10 votes
1
1 answer
497
497 views
GO Classes DPP | GATE CS, DA | Data Structure | AVL Tree
Rebalance the following tree so that it becomes a valid AVL tree:What will be the root after rebalancing?$10$ $12$ $16$ $20$
GO Classes
497
views
asked
Jul 28
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-235
goclasses-cs-dpp
goclasses-cs-dpp-day-333
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
avl-tree
+
–
6
6 votes
1
1 answer
340
340 views
GO Classes DPP | GATE CS, DA | Data Structure | Collision-Free Hash Parameter
For the keys:$47, 61, 36, 52, 56, 33, 92$consider the hash function:$h(k) = ((10k + 4) \bmod c) \bmod 7$Find the smallest positive integer $c$ such that no collisions occ...
GO Classes
340
views
asked
Jul 28
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-235
goclasses-cs-dpp
goclasses-cs-dpp-day-333
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
hashing
numerical-answers
+
–
4
4 votes
1
1 answer
275
275 views
GO Classes DPP | GATE CS, DA | Data Structure | Heap Insertion
Suppose vector $A$ is a min-heap:$A = [2, 4, 3, 6, 7, 3, 5, 8, 9]$After calling $\texttt{Push(1)}$, what is the final heap array?$[1, 2, 3, 6, 4, 3, 5, 8, 9, 7]$ $[1, 4, ...
GO Classes
275
views
asked
Jul 28
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-235
goclasses-cs-dpp
goclasses-cs-dpp-day-333
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
min-heap
+
–
10
10 votes
1
1 answer
319
319 views
GO Classes DPP | GATE CS, DA | Data Structure | Binary Tree Traversals
A binary tree has:$1000$ nodes in the left subtree $100$ nodes in the right subtreeHow many nodes are processed before the root in preorder, inorder, and postorder traver...
GO Classes
319
views
asked
Jul 28
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-235
goclasses-cs-dpp
goclasses-cs-dpp-day-333
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
binary-tree
+
–
5
5 votes
1
1 answer
235
235 views
GO Classes DPP | GATE CS, DA | Data Structure | Hash Table
Which of the following statements are true?$\text{S1}$. The worst-case complexity of checking whether an object is present in a hash set is $O(1)$.$\text{S2}$. The worst-...
GO Classes
235
views
asked
Jul 28
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-235
goclasses-cs-dpp
goclasses-cs-dpp-day-333
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
hashing
+
–
9
9 votes
2
2 answers
441
441 views
GO Classes DPP | GATE CS, DA | Data Structure | Stack and Queue Transfer
Given a stack $S$ with $5$ elements from top to bottom as:$2, 4, 6, 8, 10$and an empty queue $Q$.First, remove the elements one by one from $S$ and insert them into $Q$.T...
GO Classes
441
views
asked
Jul 27
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-234
goclasses-cs-dpp
goclasses-cs-dpp-day-332
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
stack
queue
+
–
6
6 votes
1
1 answer
279
279 views
GO Classes DPP | GATE CS, DA | Data Structure | AVL Tree
Insert the following keys into an initially empty AVL tree:$1, 2, 3, 4, 5, 6$What is the root of the final AVL tree?
GO Classes
279
views
asked
Jul 27
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-234
goclasses-cs-dpp
goclasses-cs-dpp-day-332
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
avl-tree
numerical-answers
+
–
7
7 votes
1
1 answer
247
247 views
GO Classes DPP | GATE CS, DA | Data Structure | Hashing with Chaining
Insert the keys$47, 61, 36, 52, 56, 33, 92$in order into a hash table of size $7$ using:$h(k) = (10k + 4) \bmod 7$Each slot stores a linked list, and later insertions are...
GO Classes
247
views
asked
Jul 27
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-234
goclasses-cs-dpp
goclasses-cs-dpp-day-332
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
hashing
chaining
+
–
6
6 votes
2
2 answers
341
341 views
GO Classes DPP | GATE CS, DA | Data Structure | BST Search Path
Suppose numbers between $1$ and $1000$ are stored in a binary search tree. We search for the key $363$.Which of the following sequences could not be the sequence of nodes...
GO Classes
341
views
asked
Jul 27
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-234
goclasses-cs-dpp
goclasses-cs-dpp-day-332
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
binary-search-tree
+
–
7
7 votes
1
1 answer
514
514 views
GO Classes DPP | GATE CS, DA | Data Structure | Stack & Queue
Which of the following statements are true?$\text{S1.}$ Stack operations $\texttt{push}$, $\texttt{pop}$, and $\texttt{isEmpty}$ can be worst-case $O(1)$ for a linked-lis...
GO Classes
514
views
asked
Jul 27
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-234
goclasses-cs-dpp
goclasses-cs-dpp-day-332
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
stack
queue
priority-queue
+
–
6
6 votes
1
1 answer
381
381 views
GO Classes DPP | GATE CS, DA | Data Structure | AVL Deletion & Rotation
Given the following AVL tree, delete node $\text{A}$.How many rotations are required to rebalance the AVL tree after deleting node $A$?(Count each rotation only once, whe...
GO Classes
381
views
asked
Jul 24
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-233
goclasses-cs-dpp
goclasses-cs-dpp-day-331
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
avl-tree
numerical-answers
+
–
5
5 votes
1
1 answer
295
295 views
GO Classes DPP | GATE CS, DA | Data Structure | AVL Deletion
Consider the following AVL tree:What is the minimum number of keys that must be deleted before a double rotation occurs?
GO Classes
295
views
asked
Jul 24
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-233
goclasses-cs-dpp
goclasses-cs-dpp-day-331
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
avl-tree
numerical-answers
+
–
6
6 votes
1
1 answer
213
213 views
GO Classes DPP | GATE CS, DA | Data Structure | AVL Tree
Insertion of a new element into an AVL tree may violate the AVL balance condition. Usually, we perform a rotation at the first node on the path from the inserted element ...
GO Classes
213
views
asked
Jul 24
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-233
goclasses-cs-dpp
goclasses-cs-dpp-day-331
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
avl-tree
+
–
7
7 votes
1
1 answer
223
223 views
GO Classes DPP | GATE CS, DA | Data Structure | AVL Insertion & Deletion
Consider the following AVL tree:First insert $10$ into the AVL tree. Then delete $28$ from the resulting AVL tree.What is the root of the AVL tree after both operations?$...
GO Classes
223
views
asked
Jul 24
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-233
goclasses-cs-dpp
goclasses-cs-dpp-day-331
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
avl-tree
+
–
6
6 votes
1
1 answer
200
200 views
GO Classes DPP | GATE CS, DA | Data Structure | AVL Deletion & Rebalancing
Given the following AVL tree, delete the key $1$ and rebalance the tree. What will be the root of the final AVL tree after deletion and rebalancing?$7$ $10$ $15$ $3$
GO Classes
200
views
asked
Jul 24
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-233
goclasses-cs-dpp
goclasses-cs-dpp-day-331
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
avl-tree
+
–
6
6 votes
1
1 answer
228
228 views
GO Classes DPP | GATE CS, DA | Data Structure | Valid BST and Valid AVL Tree
For the following three trees, choose the correct classification.Tree (a):Tree (b):Tree (c):Which option is correct?All three are valid AVL trees. Tree (a) is not a valid...
GO Classes
228
views
asked
Jul 23
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-232
goclasses-cs-dpp
goclasses-cs-dpp-day-330
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
avl-tree
binary-search-tree
+
–
6
6 votes
1
1 answer
201
201 views
GO Classes DPP | GATE CS, DA | Data Structure | AVL Search Complexity
What is the time complexity for efficiently finding an arbitrary item in an arbitrary AVL tree of $n$ nodes?$\Theta(n)$ $\Theta(\log_2 n)$ $\Theta(n \log_2 n)$ $\Theta(n^...
GO Classes
201
views
asked
Jul 23
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-232
goclasses-cs-dpp
goclasses-cs-dpp-day-330
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
avl-tree
+
–
7
7 votes
1
1 answer
277
277 views
GO Classes DPP | GATE CS, DA | Data Structure | AVL Insertion Property
Which statement is true for AVL trees?Adding a node may cause the tree to increase in height. Adding a node will cause the tree to increase in height. Adding a node may c...
GO Classes
277
views
asked
Jul 23
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-232
goclasses-cs-dpp
goclasses-cs-dpp-day-330
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
avl-tree
+
–
5
5 votes
1
1 answer
230
230 views
GO Classes DPP | GATE CS, DA | Data Structure | AVL Insertion
We have just inserted $51$ into the following AVL tree. Rebalance the tree.What is the root of the AVL tree after rebalancing?$35$ $42$ $47$ $57$
GO Classes
230
views
asked
Jul 23
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-232
goclasses-cs-dpp
goclasses-cs-dpp-day-330
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
avl-tree
+
–
7
7 votes
2
2 answers
408
408 views
GO Classes DPP | GATE CS, DA | Data Structure | Valid AVL Trees
Which of the following trees are valid AVL trees?
GO Classes
408
views
asked
Jul 23
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-232
goclasses-cs-dpp
goclasses-cs-dpp-day-330
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
avl-tree
+
–
10
10 votes
1
1 answer
250
250 views
GO Classes DPP | GATE CS, DA | Data Structure | Heapify
Heaps are usually implemented using arrays.If an element is present at a known array index in a heap of size $N$, what is the time complexity to remove that element and r...
GO Classes
250
views
asked
Jul 22
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-231
goclasses-cs-dpp
goclasses-cs-dpp-day-329
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
binary-heap
heapify
+
–
4
4 votes
2
2 answers
260
260 views
GO Classes DPP | GATE CS, DA | Data Structure | Heap to AVL Tree
Given a binary min-heap storing $n$ comparable keys, can we always build a Set AVL Tree containing the same keys using only $O(n)$ comparisons?True False
GO Classes
260
views
asked
Jul 22
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-231
goclasses-cs-dpp
goclasses-cs-dpp-day-329
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
min-heap
avl-tree
+
–
4
4 votes
1
1 answer
178
178 views
GO Classes DPP | GATE CS, DA | Data Structure | Priority Update in Min-Heap
Consider the following min-heap where each node is written as $\texttt{(value, priority)}$:Now perform these operations in order:$\texttt{updatePriority(A, 8)}$ $\texttt{...
GO Classes
178
views
asked
Jul 22
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-231
goclasses-cs-dpp
goclasses-cs-dpp-day-329
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
min-heap
priority-queue
+
–
4
4 votes
1
1 answer
169
169 views
GO Classes DPP | GATE CS, DA | Data Structure | Heapify-Down
Start with the min-heap obtained after inserting:$$10, 12, 1, 14, 6, 5, 8, 15, 3, 9$$The heap array is:$$[1, 3, 5, 6, 9, 10, 8, 15, 14, 12]$$Now perform three $\texttt{De...
GO Classes
169
views
asked
Jul 22
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-231
goclasses-cs-dpp
goclasses-cs-dpp-day-329
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
min-heap
heapify
+
–
6
6 votes
1
1 answer
176
176 views
GO Classes DPP | GATE CS, DA | Data Structure | Build Min-Heap
Insert the following values one by one into an initially empty minimum binary heap:$$10, 12, 1, 14, 6, 5, 8, 15, 3, 9$$What is the final heap array in level-order?$[1, 3,...
GO Classes
176
views
asked
Jul 22
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-231
goclasses-cs-dpp
goclasses-cs-dpp-day-329
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
min-heap
+
–
5
5 votes
1
1 answer
226
226 views
GO Classes DPP | GATE CS, DA | Data Structure | Heap Sort
During heap sort, the array looks like this:$J = [7, 3, 6, 2, 1, 4, 5, 8, 9]$Assume heap sort is using a max-heap to sort the array in increasing order.How many elements ...
GO Classes
226
views
asked
Jul 21
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-230
goclasses-cs-dpp
goclasses-cs-dpp-day-328
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
max-heap
heap-sort
numerical-answers
+
–
4
4 votes
1
1 answer
193
193 views
GO Classes DPP | GATE CS, DA | Data Structure | Heap Sort
A max-heap is stored using $0$-based indexing as:$$[60, 30, 45, 15, 5, 10, 20]$$During the first iteration of heap sort:Swap the root with the last element. Reduce the he...
GO Classes
193
views
asked
Jul 21
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-230
goclasses-cs-dpp
goclasses-cs-dpp-day-328
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
max-heap
binary-heap
heap-sort
+
–
5
5 votes
2
2 answers
186
186 views
GO Classes DPP | GATE CS, DA | Data Structure | DeleteMin from Min-Heap
A min-heap is stored using $1$-based indexing as:$[2, 13, 7, 17, 14, 22, 8, 21]$After one $\texttt{DeleteMin}$ operation, what is the final heap array?$[7, 13, 8, 17, 14,...
GO Classes
186
views
asked
Jul 21
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-230
goclasses-cs-dpp
goclasses-cs-dpp-day-328
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
min-heap
binary-heap
+
–
5
5 votes
2
2 answers
198
198 views
GO Classes DPP | GATE CS, DA | Data Structure | Insert in Max-Heap
The following max-heap is stored using $1$-based indexing:$[57, 53, 42, 48, 25, 34, 29, 18, 30, 25]$Insert $55$ into this max-heap. What is the final heap array?$[57, 55,...
GO Classes
198
views
asked
Jul 21
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-230
goclasses-cs-dpp
goclasses-cs-dpp-day-328
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
max-heap
binary-heap
+
–
7
7 votes
1
1 answer
179
179 views
GO Classes DPP | GATE CS, DA | Data Structure | Binary Min-Heaps
Consider the following binary min-heap:Perform the following operations in order:$\text{DeleteMin}$ $\text{Insert 8}$ $\text{Insert 2}$ What is the final array representa...
GO Classes
179
views
asked
Jul 21
Data Structures
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-230
goclasses-cs-dpp
goclasses-cs-dpp-day-328
data-structures
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-ds-practice-questions
min-heap
binary-heap
+
–
Page:
1
2
3
4
5
6
...
86
next »