Posts

Showing posts from June, 2025
GATE 2025 CS/IT Question 65 GATE2025_CS1_Q65 In a double hashing scheme, h₁(k) = k mod 11 and h₂(k) = 1 + (k mod 7) are the auxiliary hash functions. The size m of the hash table is 11. The hash function for the i-th probe in the open address table is [h₁(k) + i h₂(k)] mod m. The following keys are inserted in the given order: 63, 50, 25, 79, 67, 24. The slot at which key 24 gets stored is ______. (Answer in integer) Check Answer 👁️ View Full Answer ✅ Final Answer: The correct answer is 10 . 🔹 Short Answer: To find the slot for key 24, we calculate its hash values: h₁(24) = 24 mod 11 = 2 and h₂(24) = 1 + (24 mod 7) = 1 + 3 = 4. We then probe the hash table. Probe 0: `(2 + 0*4) mod 11 = 2` (collision). Probe 1: `(2 + 1*4) mod 11 = 6` (collision). Probe 2: `(2 + 2*4) mod 11 = 10` (empty). Key 24 is placed in slot 10. 🔸 Long Answer: This problem requi...
Image
GATE 2025 CS/IT Question 64 GATE2025_CS1_Q64 The maximum value of x such that the edge between the nodes B and C is included in every minimum spanning tree of the given graph is ______. (answer in integer) Check Answer 👁️ View Full Answer ✅ Final Answer: The correct answer is 5 . 🔹 Short Answer: For edge (B,C) to be in *every* MST, its weight 'x' must be strictly less than the bottleneck (heaviest edge) of any alternative path between B and C. The alternative paths and their bottlenecks are: B-A-C (bottleneck 7), B-D-C (bottleneck 8), and B-D-A-C (bottleneck 6). To satisfy all conditions, 'x' must be less than the minimum of these bottlenecks, so `x 🔸 Long Answer: Graph for MST Question A B C D 7 6 x ...
GATE 2025 CS/IT Question 63 GATE2025_CS1_Q63 Consider the following C program: #include int gate (int n) { int d, t, newnum, turn; newnum = turn = 0; t=1; while (n>=t) t *= 10; t /=10; while (t>0) { d = n/t; n = n%t; t /= 10; if (turn) newnum = 10*newnum + d; turn = (turn + 1) % 2; } return newnum; } int main () { printf ("%d", gate(14362)); return 0; } The value printed by the given C program is ______. (Answer in integer) Check Answer 👁️ View Full Answer ✅ Final Answer: The correct answer is 46 . 🔹 Short Answer: The C program's `gate` function isolates each digit of the input number from left to right. A `turn` variable alternates between 0 and 1. The `if (turn)` condition ensures that only digits from even positions (2nd, 4th, 6th, etc.) are used to build a new number. For the input 14362, the 2nd digit (4) and ...