Webpage

Arrays, Stacks, Queues, Linked lists, Trees, Binary search trees, Binary heaps, Graphs.

$$\scriptsize{\overset{{\large{\textbf{Mark Distribution in Previous GATE}}}}{\begin{array}{|c|c|c|c|c|c|c|c|}\hline
\textbf{Year}&\textbf{2024-1} &\textbf{2024-2} &\textbf{2023} & \textbf{2022} & \textbf{2021-1}&\textbf{2021-2}&\textbf{Minimum}&\textbf{Average}&\textbf{Maximum}
\\\hline\textbf{1 Mark Count} & 0&0&2 &2 &4&2&0&1.67&4
\\\hline\textbf{2 Marks Count} &1&2&3& 1 &1&0&0&1.33&3
\\\hline\textbf{Total Marks} &2&4&8& 4&6&2&\bf{2}&\bf{4.33}&\bf{8}\\\hline
\end{array}}}$$

#1
146
views
0 answers
0 votes
The array-based stack throws an exception when the array's capacity has been reached. Consider the following alternative : create a larger array, using the resize method. The cost ... the resize, elements maySolutions = O(N^2)O(N)O(N^2)O(N)
#2
306
views
1 answers
1 votes
Consider an integer upper triangular 2D array arr[–8 to +7][–8 to +7] having base address 1000. If the size of the integer is 4 bytes, the address of the element present at location arr[–6][4] is- ____________.
#3
960
views
2 answers
0 votes
Match the items in Column $1$ with the items in Column $2$ in the following table:\begin{array}{|ll|ll|}\hline & \text{Column 1} & & \text{Column 2} \\\hline \ ...
#4
1.0k
views
1 answers
1 votes
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 ... )$\frac{1}{1-\alpha}$1+\frac{\alpha}{2}$\frac{1}{1+\alpha}$
#5
1.3k
views
1 answers
0 votes
Consider the following tree traversals on a full binary tree:PreorderInorderPostorderWhich of the following traversal options is/are sufficient to uniquely reconstruct the full binary ... $\text{(ii) only}$
#6
866
views
1 answers
0 votes
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 ... removeLast ()The value of $\mathbf{a}$ is $\_\_\_\_\_\_\_\_$.
#7
1.1k
views
2 answers
2 votes
Let $H, I, L$, and $N$ represent height, number of internal nodes, number of leaf nodes, and the total number of nodes respectively in a rooted binary tree.Which of the following ... $H \leq L \leq 2^{H-1}$
#8
2.3k
views
1 answers
3 votes
You are given a set $V$ of distinct integers. A binary search tree $T$ is created by inserting all elements of $V$ one by one, starting with an ... $V$Postorder traversal of $T$ can be determined from $V$
#9
2.7k
views
1 answers
3 votes
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. ... $200,300,400,100$400,200,100,300$300,200,400,100$
#10
3.3k
views
2 answers
1 votes
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$
#11
505
views
1 answers
4 votes
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 ... $O(1)$ for dequeue.$O(n)$ for both functions.
#12
628
views
2 answers
5 votes
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 ... all eight keys of $A$ are present in $B$.How many leaf nodes are present in B?
#13
665
views
1 answers
7 votes
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 ... as it is used. Your final count should include initial 3 PUSH instructions.
#14
472
views
2 answers
2 votes
Consider a binary tree. Among the following traversal combinations, which of them can uniquely construct the tree?Inorder + PreorderPreorder + PostorderOnly InorderInorder + Postorder
#15
285
views
1 answers
0 votes
Consider a doubly linked list with the following operations:- Insert First (\texttt{InsertFirst})\\- Insert Last (\texttt{InsertLast})\\- Remove First (\texttt{ ... \end{aligned}\]What is the value of \(a\) after these operations?
#16
266
views
1 answers
0 votes
#17
293
views
0 answers
0 votes
Data Structure question: Binary tree question having four options involving no of internal nodes, leaf nodes, height etc.
#18
566
views
1 answers
6 votes
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 ... $3$ came before $14$ and $16$ came before $28.$
#19
618
views
1 answers
3 votes
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)
#20
490
views
1 answers
3 votes
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$