Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged data-structures
0
votes
1
answer
1
#algorithm
how many spanning trees are possible for complete graph of 4 vertices
how many spanning trees are possible for complete graph of 4 vertices
Amoljadhav
96
views
Amoljadhav
asked
Mar 1
Algorithms
algorithms
data-structures
graph-theory
+
–
0
votes
1
answer
2
Linked List
How can we find the highest element in a singly linked list in O(1)? We are free to use any extra space.
How can we find the highest element in a singly linked list in O(1)? We are free to use any extra space.
Mrityudoot
144
views
Mrityudoot
asked
Feb 25
Programming in C
linked-list
data-structures
algorithms
+
–
0
votes
1
answer
3
GATE DS&AI 2024 | Question: 11
Consider performing uniform hashing on an open address hash table with load factor $\alpha=\frac{n}{m}<1$, where $n$ elements are stored in the table with $m$ slots. The expected number of probes in an unsuccessful search is at most $\frac{1}{1-\alpha}$. Inserting ... $\frac{1}{1-\alpha}$ $1+\frac{\alpha}{2}$ $\frac{1}{1+\alpha}$
Consider performing uniform hashing on an open address hash table with load factor $\alpha=\frac{n}{m}<1$, where $n$ elements are stored in the table wi...
Arjun
696
views
Arjun
asked
Feb 16
DS
gate-ds-ai-2024
data-structures
hashing
uniform-hashing
+
–
0
votes
1
answer
4
GATE DS&AI 2024 | Question: 22
The fundamental operations in a double-ended queue $D$ are: insertFirst (e) - Insert a new element $e$ at the beginning of $D$. insertLast (e) - Insert a new element $e$ at the end of D. removeFirst () - Remove and return the first element of $D$. removeLast () ... $\mathbf{a} \leftarrow$ removeLast () The value of $\mathbf{a}$ is $\_\_\_\_\_\_\_\_$.
The fundamental operations in a double-ended queue $D$ are: insertFirst (e) - Insert a new element $e$ at the beginning of $D$. insertLast (e) - Insert a new element $e$ ...
Arjun
664
views
Arjun
asked
Feb 16
DS
gate-ds-ai-2024
numerical-answers
data-structures
+
–
1
votes
1
answer
5
GATE CSE 2024 | Set 2 | Question: 38
Let $\mathrm{S} 1$ and $\mathrm{S} 2$ be two stacks. $\mathrm{S} 1$ has capacity of $4$ elements. $\mathrm{S} 2$ has capacity of $2$ elements. $\text{S1}$ already has $4$ elements: $100,200,300$, and $400$ ... output sequences can be generated by using the above operations? $100,200,400,300$ $200,300,400,100$ $400,200,100,300$ $300,200,400,100$
Let $\mathrm{S} 1$ and $\mathrm{S} 2$ be two stacks. $\mathrm{S} 1$ has capacity of $4$ elements. $\mathrm{S} 2$ has capacity of $2$ elements. $\text{S1}$ ...
Arjun
1.8k
views
Arjun
asked
Feb 16
DS
gatecse2024-set2
data-structures
stack
multiple-selects
+
–
0
votes
2
answers
6
GATE CSE 2024 | Set 1 | Question: 33
Consider a binary min-heap containing $105$ distinct elements. Let $k$ be the index (in the underlying array) of the maximum element stored in the heap. The number of possible values of $k$ is $53$ $52$ $27$ $1$
Consider a binary min-heap containing $105$ distinct elements. Let $k$ be the index (in the underlying array) of the maximum element stored in the heap. The number of pos...
Arjun
2.0k
views
Arjun
asked
Feb 16
DS
gatecse2024-set1
data-structures
+
–
4
votes
1
answer
7
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 34
Suppose you implement a queue using a singly linked list with head and tail pointers so that the front of the queue is at the tail of the list, and the rear of the queue is at the head of the list. What is the best possible worst-case running ... $O(n)$ for dequeue. $O(n)$ for enqueue and $O(1)$ for dequeue. $O(n)$ for both functions.
Suppose you implement a queue using a singly linked list with head and tail pointers so that the front of the queue is at the tail of the list, and the rear of the queue ...
GO Classes
333
views
GO Classes
asked
Feb 5
DS
goclasses2024-mockgate-14
data-structures
queue
linked-list
1-mark
+
–
5
votes
2
answers
8
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 44
Let $B$ be a binary search tree (BST) with eight nodes filled with the following set of eight integer keys $A=\{10,2,5,3,20,15,9,22\}$. The order in which these keys were inserted to create $B$ is not known. However ... are required to verify if all eight keys of $A$ are present in $B$. How many leaf nodes are present in B?
Let $B$ be a binary search tree (BST) with eight nodes filled with the following set of eight integer keys $A=\{10,2,5,3,20,15,9,22\}$. The order in which these keys were...
GO Classes
423
views
GO Classes
asked
Feb 5
DS
goclasses2024-mockgate-14
numerical-answers
data-structures
binary-search-tree
2-marks
+
–
7
votes
1
answer
9
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 45
Consider a stack whose elements are unsigned integers and support the following operations: PUSH a: Pushes the element 'a' onto the stack. ADD: Adds the two topmost elements, removes them, and pushes the result. SQR: ... once, count it as many times as it is used. Your final count should include initial 3 PUSH instructions.
Consider a stack whose elements are unsigned integers and support the following operations:PUSH a: Pushes the element 'a' onto the stack.ADD: Adds the two topmost element...
GO Classes
480
views
GO Classes
asked
Feb 5
DS
goclasses2024-mockgate-14
numerical-answers
data-structures
stack
2-marks
+
–
2
votes
2
answers
10
Memory Based GATE DA 2024 | Question: 23
Consider a binary tree. Among the following traversal combinations, which of them can uniquely construct the tree? Inorder + Preorder Preorder + Postorder Only Inorder Inorder + Postorder
Consider a binary tree. Among the following traversal combinations, which of them can uniquely construct the tree?Inorder + PreorderPreorder + PostorderOnly InorderInorde...
GO Classes
274
views
GO Classes
asked
Feb 4
DS
gate2024-da-memory-based
goclasses
data-structures
binary-tree
tree-traversal
+
–
0
votes
1
answer
11
Memory Based GATE DA 2024 | Question: 24
Consider a doubly linked list with the following operations: - Insert First (\texttt{InsertFirst}) \\ - Insert Last (\texttt{InsertLast}) \\ - Remove First (\texttt{RemoveFirst}) \\ - Remove Last (\texttt{RemoveLast}) The following operations are ... \ & a = \text{RemoveLast} \end{aligned} \] What is the value of \(a\) after these operations?
Consider a doubly linked list with the following operations:- Insert First (\texttt{InsertFirst})\\- Insert Last (\texttt{InsertLast})\\- Remove First (\texttt{RemoveFirs...
GO Classes
159
views
GO Classes
asked
Feb 4
DS
gate2024-da-memory-based
goclasses
data-structures
linked-list
numerical-answers
+
–
0
votes
1
answer
12
Memory Based GATE DA 2024 | Question: 40
Match the following: $ \begin{array}{|p{0.3\linewidth}|p{0.6\linewidth}|} \hline \textbf{Technique} & \textbf{Characteristic} \\ \hline FIFO & (ii) Queue \\ \hline Look Up & (i) Hash Table\\ \hline LIFO & (iii) Stack \\ \hline \end{array} $
Match the following:$$\begin{array}{|p{0.3\linewidth}|p{0.6\linewidth}|} \hline \textbf{Technique} & \textbf{Characteristic} \\ \hline FIFO & ...
GO Classes
160
views
GO Classes
asked
Feb 4
DS
gate2024-da-memory-based
goclasses
data-structures
stack
+
–
0
votes
0
answers
13
Memory Based GATE DA 2024 | Question: 55
Data Structure question: Binary tree question having four options involving no of internal nodes, leaf nodes, height etc.
Data Structure question: Binary tree question having four options involving no of internal nodes, leaf nodes, height etc.
GO Classes
188
views
GO Classes
asked
Feb 4
DS
gate2024-da-memory-based
goclasses
data-structures
binary-tree
+
–
6
votes
1
answer
14
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 16
Suppose we constructed the binary search tree shown by starting with an empty tree and inserting one element at a time from an input sequence, without any rotations or other manipulations. Which of the following assertions about the order of elements in ... $29$ came before $42.$ $3$ came before $14$ and $16$ came before $28.$
Suppose we constructed the binary search tree shown by starting with an empty tree and inserting one element at a time from an input sequence, without any rotations or ot...
GO Classes
407
views
GO Classes
asked
Jan 28
DS
goclasses2024-mockgate-13
goclasses
data-structures
binary-search-tree
1-mark
+
–
3
votes
1
answer
15
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 17
Suppose that a binary min-heap stores six elements with priorities $10,20,30,40,50$, and $60$ in its array $\text{A}.$ What is the largest of these items that could be stored in $\text{A}[2]?$ (indexing starts from zero)
Suppose that a binary min-heap stores six elements with priorities $10,20,30,40,50$, and $60$ in its array $\text{A}.$ What is the largest of these items that could be st...
GO Classes
441
views
GO Classes
asked
Jan 28
DS
goclasses2024-mockgate-13
goclasses
numerical-answers
data-structures
binary-heap
1-mark
+
–
3
votes
1
answer
16
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 36
Let $\mathrm{T}$ be the smallest AVL tree of height $h$. How many nodes does it have, if the smallest AVL tree of height $h-2$ has $m$ nodes and the smallest AVL tree of height $h-3$ has $k$ nodes? $m+k+2$ $m+2 k$ $2 m+k$ $2 m+k+2$
Let $\mathrm{T}$ be the smallest AVL tree of height $h$. How many nodes does it have, if the smallest AVL tree of height $h-2$ has $m$ nodes and the smallest AVL tree of ...
GO Classes
342
views
GO Classes
asked
Jan 28
DS
goclasses2024-mockgate-13
goclasses
data-structures
avl-tree
2-marks
+
–
4
votes
2
answers
17
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 37
Consider the null-terminated linked list of four integers $\textsf{1->2->3->4->NULL},$ and the variable 'list' points to the head of the linked list. Upon running the provided code, the linked list gets divided ... X:list->next->next>next = list->next>next; LINE Y: list = list->next->next;
Consider the null-terminated linked list of four integers $\textsf{1->2->3->4->NULL},$ and the variable 'list' points to the head of the linked list. Upon running the pro...
GO Classes
384
views
GO Classes
asked
Jan 28
DS
goclasses2024-mockgate-13
goclasses
data-structures
linked-list
2-marks
+
–
7
votes
3
answers
18
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 40
You are given a complete binary tree (each level must be full except the last) on $n$ vertices. Each vertex $v$ is labeled by an integer value $x_v$. Say that a vertex is a local minimum if its label is less than the labels of each of its ... minimum in the tree? $\theta(n)$ $\theta(\sqrt{n})$ $\theta(\log n)$ $\theta(n \log n)$
You are given a complete binary tree (each level must be full except the last) on $n$ vertices. Each vertex $v$ is labeled by an integer value $x_v$. Say that a vertex is...
GO Classes
724
views
GO Classes
asked
Jan 28
DS
goclasses2024-mockgate-13
goclasses
data-structures
binary-tree
time-complexity
2-marks
+
–
3
votes
1
answer
19
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 3
The Euclidean algorithm is used to find the greatest common divisor $(\mathrm{gcd})$ of two positive integers $\mathrm{a}$ and $\mathrm{b}$. input(a) input(b) while b>0 begin r:= a mod b a:= b b:= r end gcd:= a output(gcd) When the algorithm ... is the sequence of computed values for $r?$ $2,53,1,0$ $53,2,1,0$ $53,4,1,0$ $53,5,1,0$
The Euclidean algorithm is used to find the greatest common divisor $(\mathrm{gcd})$ of two positive integers $\mathrm{a}$ and $\mathrm{b}$.input(a) input(b) while b>0 be...
GO Classes
350
views
GO Classes
asked
Jan 21
DS
goclasses2024-mockgate-12
goclasses
data-structures
linked-list
1-mark
+
–
2
votes
1
answer
20
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 4
What are the sequence of popped-out values if the sequence of operations - $\textsf{push(1), push(2), pop, push(1), push(2), pop, pop, pop, push(2), pop}$ are performed on a stack? $2, 2, 1, 1, 2$ $2, 2, 1, 1, 1$ $2, 1, 2, 2, 1$ $2, 1, 2, 2, 2$
What are the sequence of popped-out values if the sequence of operations - $\textsf{push(1), push(2), pop, push(1), push(2), pop, pop, pop, push(2), pop}$ are performed o...
GO Classes
297
views
GO Classes
asked
Jan 21
DS
goclasses2024-mockgate-12
goclasses
data-structures
stack
1-mark
easy
+
–
2
votes
1
answer
21
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 31
How many binary trees with $3$ nodes, $\text{A, B},$ and $\text{C}$ when traversed in post-order will give the sequence $\text{A, B, C}?$ (It is NOT a search tree)
How many binary trees with $3$ nodes, $\text{A, B},$ and $\text{C}$ when traversed in post-order will give the sequence $\text{A, B, C}?$ (It is NOT a search tree)
GO Classes
414
views
GO Classes
asked
Jan 21
DS
goclasses2024-mockgate-12
goclasses
numerical-answers
data-structures
binary-tree
tree-traversal
2-marks
+
–
4
votes
2
answers
22
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 32
The in-order traversal of a binary tree is $\textsf{HFIEJGZ},$ and the post-order traversal of the same tree is $\textsf{HIFJZGE}.$ What will be the total number of nodes in the left sub-tree of the given tree? (It is NOT a search tree)
The in-order traversal of a binary tree is $\textsf{HFIEJGZ},$ and the post-order traversal of the same tree is $\textsf{HIFJZGE}.$ What will be the total number of nodes...
GO Classes
350
views
GO Classes
asked
Jan 21
DS
goclasses2024-mockgate-12
goclasses
numerical-answers
data-structures
binary-tree
tree-traversal
2-marks
+
–
0
votes
3
answers
23
Made Easy Test Series
In a max heap of n elements, the time complexity to find 10th largest element is: a)Θ(n log n) b)Θ(n) c)Θ(1) d)Θ(log n) I personally think it should be Θ(n), as the 10th largest element can be anywhere in the heap, all the elements need to be traversed once to decide that.
In a max heap of n elements, the time complexity to find 10th largest element is:a)Θ(n log n)b)Θ(n)c)Θ(1)d)Θ(log n) I personally think it should be Θ(n), as the 10th...
Mrityudoot
210
views
Mrityudoot
asked
Jan 20
DS
made-easy-test-series
data-structures
+
–
6
votes
0
answers
24
GO Classes Test Series 2024 | Mock GATE | Test 11 | Question: 52
Consider the following binary heap – Suppose the last operation you performed in the binary heap above was inserting the key $x$. What are the possible values of $x?$ $20$ $8$ $13$ $11$
Consider the following binary heap –Suppose the last operation you performed in the binary heap above was inserting the key $x$.What are the possible values of $x?$$20$...
GO Classes
495
views
GO Classes
asked
Jan 13
DS
goclasses2024-mockgate-11
goclasses
data-structures
binary-heap
multiple-selects
2-marks
+
–
2
votes
1
answer
25
GO Classes Test Series 2024 | Mock GATE | Test 11 | Question: 53
Consider the linked list initially having values $1, 2, 2, 8, 6, 2, 2,$ and let the head be the pointer to the first node of the linked list. Which of the following options correctly represents the final linked list after the function call ... LinkedList will be $1, 8, 6$ Final LinkedList will be $1, 8, 6, 2, 2$ None of the above
Consider the linked list initially having values $1, 2, 2, 8, 6, 2, 2,$ and let the head be the pointer to the first node of the linked list.Which of the following option...
GO Classes
317
views
GO Classes
asked
Jan 13
DS
goclasses2024-mockgate-11
goclasses
data-structures
linked-list
2-marks
+
–
0
votes
1
answer
26
ISRO 2024
From a character string of lenth $m$, the number of sub-strings of all lengths that can be formed are: $m^2$ $m$ $m(m+1)/2$ $m(\log m)$
From a character string of lenth $m$, the number of sub-strings of all lengths that can be formed are:$m^2$$m$$m(m+1)/2$$m(\log m)$
Ramayya
173
views
Ramayya
asked
Jan 7
DS
data-structures
+
–
1
votes
3
answers
27
ISRO 2024
In a priority queue, insertion and deletion can be done at Front back Middle Any position
In a priority queue, insertion and deletion can be done atFrontbackMiddleAny position
Ramayya
414
views
Ramayya
asked
Jan 7
DS
isro-2024
priority-queue
data-structures
+
–
Page:
1
2
3
4
5
6
...
60
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register