Recent questions tagged three-marks

1 1 vote
0 0 answers
390
390 views
Consider the following C program:#include <stdio.h void func(int *a, int *b) { int i = (*a) * (*b); int *j = b; for (;;) { if (i 20) ...
0 0 votes
0 0 answers
301
301 views
Consider a hash table with $100$ slots. Collisions are resolved using chaining. Assuming simple uniform hashing, what is the probability that the first $3$ slots are unfi...
2 2 votes
1 1 answer
353
353 views
Size of $\verb|int|$ is $\mathrm{2~B}$ and size of $\verb|float|$ is $\mathrm{4~B}$Consider the following C++ program:#include<iostream using namespace std; int main() { ...
1 1 vote
1 1 answer
265
265 views
Consider the following C declarations and their interpretations:$\verb|void * foo(void *)| : \verb|foo|$ is a function that takes an argument of type $\verb|void|$ and re...
1 1 vote
1 1 answer
265
265 views
Consider the following function that reverses a singly linked list.Node* reverseList(Node* head) { Node* prev = NULL; Node* current = head; Node* next = NULL;...
0 0 votes
1 1 answer
269
269 views
Consider the following function:void f(stack S) { int x ; if (!isEmpty(S)) { x = pop(S); f(S); push(S, x); } }What operation is performed by t...
1 1 vote
1 1 answer
254
254 views
Consider inserting the following sequence of keys into an initially empty AVL tree:$$38,53,42,26,33,60,79,21,20$$During the construction of the AVL tree, rotations are pe...
1 1 vote
1 1 answer
267
267 views
A queue initially contains the elements (from front to rear):$$1~2~3~4~5~6$$An empty stack is also available. The following operations can be performed:Dequeue an element...
0 0 votes
1 1 answer
296
296 views
In the balanced binary search tree in the below figure, how many nodes will become unbalanced when a node with value $97$ is inserted?$1$ $2$ $3$ $4$
0 0 votes
1 1 answer
264
264 views
Consider the following function defined on a binary tree:int func(Node* root) { if (root == NULL) { return 0; } int l = func(root->left); int...
0 0 votes
1 1 answer
236
236 views
Consider the following C function:void foo (int n) { while (n < 100) { if (n = 5) { printf("Inside\n"); break; } ...
0 0 votes
0 0 answers
235
235 views
Consider the following C program.#include <stdio.h union p { char a; char b; int c; }; int main() { union p s; s.a = 20; s.b = 20; s.c = ...
0 0 votes
1 1 answer
264
264 views
Consider a Binary Search Tree (BST) containing $n$ nodes. The task is to find the median element of the BST and then delete that node from the tree.What is the time compl...
1 1 vote
0 0 answers
214
214 views
A new sorting algorithm is proposed to arrange an array in descending order. The algorithm scans the elements of the array sequentially. If an element is found to be out ...
0 0 votes
0 0 answers
206
206 views
An array of size $n$ is given in sorted order. We want to find the ceiling of a given value $x$ in the array.The ceiling of $x$ is defined as the smallest element in the ...
0 0 votes
2 2 answers
286
286 views
Consider the directed weighted graph shown in the figure. Assume that Dijkstra's shortest path algorithm is executed with node $A$ as the source. For which of the nodes d...
0 0 votes
0 0 answers
186
186 views
Consider the graph shown in the figure.Breadth-First Search (BFS) traversal is performed starting from node $D$. Which of the following sequences could be a valid BFS tra...
1 1 vote
1 1 answer
231
231 views
Let $f(n)$ and $g(n)$ be two functions. Recall that $f(n)=O(g(n))$ if there exist positive constants $c$ and $n_{0}$ such that for all $n \geq n_{0}$,$$f(n) \leq c \cdot ...
1 1 vote
2 2 answers
248
248 views
Consider the weighted undirected graph shown in the figure.Which of the following edges can never be part of any Minimum Spanning Tree of this graph?$(C, E)$ $(B, C)$ $(F...
1 1 vote
1 1 answer
195
195 views
Consider the directed graph shown in the figure.Which of the following sequences of vertices is (are) a valid topological ordering of the given graph?$V_{2}, V_{1}, V_{3}...
0 0 votes
0 0 answers
179
179 views
Insertion Sort is used to sort an array of distinct integers in descending order (largest element first).For which of the following input arrays will the algorithm perfor...
1 1 vote
1 1 answer
219
219 views
In the network shown in the figure, the cost of each link between routers is given. Assume that a routing algorithm is used and the routing tables have already converged....
1 1 vote
2 2 answers
266
266 views
Consider the different activities related to email.$\text{m1}:$ Send an email from mail client to mail server $\text{m2}:$ Download an email from mailbox server to a mail...
0 0 votes
0 0 answers
183
183 views
An Internet Service Provider (ISP) has the following chunk of CIDR-based IP addresses available with it: $245.248.128.0/20$. The ISP wants to give half of this chunk of a...
1 1 vote
0 0 answers
192
192 views
Note: 4 statements were given.Consider the following statements related to TCP congestion control mechanisms.The Slow Start phase helps prevent queue overflow by graduall...
1 1 vote
1 1 answer
211
211 views
A long-distance remote connection is established between two nodes. The following parameters are given:Data size $=1024 ~\mathrm{Bytes}$ Bandwidth $=1 \mathrm{~Gb} / \mat...
1 1 vote
1 1 answer
241
241 views
Consider the following statements related to the Time-To-Live (TTL) or hop-count field in IP networking.A router decrements the hop-count of a packet and accepts the pack...
0 0 votes
1 1 answer
212
212 views
Consider the following statements about routing algorithms in computer networks.In Distance Vector Routing (DVR), the count-to-infinity problem occurs when a new node ent...
1 1 vote
1 1 answer
206
206 views
Consider the following statements related to IPv4 and IPv6 networking.The minimum MTU size required for IPv6 is smaller than the minimum allowable MTU size in IPv4. ARP c...
1 1 vote
1 1 answer
183
183 views
A network uses a Token Bucket traffic shaping mechanism.The bucket capacity is $8 \mathrm{~Mb}$ and tokens are generated at a rate of $1 \mathrm{Mb} / \mathrm{s}$. Assume...