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}}}$$

Most viewed questions in DS

#21
32.1k
views
9 answers
81 votes
Consider the following operation along with Enqueue and Dequeue operations on queues, where $k$ is a global parameter.MultiDequeue(Q){ m = k while (Q is not empty) and (m...
#22
31.8k
views
8 answers
55 votes
A circularly linked list is used to represent a Queue. A single variable $p$ is used to access the Queue. To which node should $p$ point such that both the operations $\t...
#23
31.5k
views
5 answers
35 votes
The number of leaf nodes in a rooted tree of n nodes, with each node having $0$ or $3$ children is:$\frac{n}{2}$$\frac{(n-1)}{3}$$\frac{(n-1)}{2}$$\frac{(2n+1)}{3}$
#24
31.3k
views
9 answers
71 votes
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 ...
#25
31.0k
views
12 answers
35 votes
A binary tree T has $20$ leaves. The number of nodes in T having two children is ______.
#26
30.9k
views
5 answers
27 votes
A binary search tree is generated by inserting in order the following integers:$$50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24$$The number of nodes in the left subtree and ...
#27
30.2k
views
11 answers
62 votes
Consider a hash function that distributes keys uniformly. The hash table size is $20$. After hashing of how many keys will the probability that any new key hashed collide...
#28
30.2k
views
8 answers
45 votes
Let $A$ be a two dimensional array declared as follows:A: array [1 …. 10] [1 ….. 15] of integer;Assuming that each integer takes one memory location, the array is sto...
#29
28.8k
views
12 answers
75 votes
In a compact single dimensional array representation for lower triangular matrices (i.e all the elements above the diagonal are zero) of size $n \times n$, non-zero eleme...
#30
28.8k
views
2 answers
3 votes
A doubly linked list is declared as:struct Node { int Value; struct Node *Fwd; struct Node *Bwd; };Where Fwd and Bwd represent forward and backward link to the adjacent e...
#31
28.3k
views
11 answers
35 votes
A circular queue has been implemented using a singly linked list where each node consists of a value and a single pointer pointing to the next node. We maintain exactly t...
#32
27.8k
views
10 answers
73 votes
A hash table of length $10$ uses open addressing with hash function $h(k) = k \: \mod \: 10$, and linear probing. After inserting $6$ values into an empty hash table, the...
#33
27.1k
views
9 answers
37 votes
What is the worst case time complexity of inserting $n$ elements into an empty linked list, if the linked list needs to be maintained in sorted order?$\Theta(n)$$\Theta(n...
#34
26.6k
views
11 answers
57 votes
In a binary tree, the number of internal nodes of degree $1$ is $5$, and the number of internal nodes of degree $2$ is $10$. The number of leaf nodes in the binary tree i...
#35
26.3k
views
5 answers
73 votes
A complete binary min-heap is made by including each integer in $[1, 1023]$ exactly once. The depth of a node in the heap is the length of the path from the root of the h...
#36
26.2k
views
8 answers
31 votes
A complete $n-ary$ tree is a tree in which each node has $n$ children or no children. Let $I$ be the number of internal nodes and $L$ be the number of leaves in a complet...
#37
26.2k
views
11 answers
85 votes
Consider the C code fragment given below.typedef struct node { int data; node* next; } node; void join(node* m, node* n) { node* p = n; while(p->next != NULL) { p = p->ne...
#38
26.1k
views
1 answers
0 votes
In a linked list with $n$ nodes, the time taken to insert an element after an elementpointed by some pointer is:$(A) O(1)$$(B) O(logn)$$(C) O(n)$$(D) O(nlogn)$
#39
26.1k
views
4 answers
26 votes
The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height $h$ is:$2^h -1$$2^{h-1} -1$$2^...
#40
25.7k
views
1 answers
1 votes
Which one of the following is an application of Queue Data Structure?AWhen a resource is shared among multiple consumers.BWhen data is transferred asynchronously (data no...