GATE

Two numbers are chosen independently and uniformly at random from the set {1, 2 , . . . , 13}. The probability (rounded off to 3 decimal places) that their 4-bit (unsigned) binary representations

Two numbers are chosen independently and uniformly at random from the set {1, 2 , . . . , 13}. The probability (rounded off to 3 decimal places) that their 4-bit (unsigned) binary representations

Q. Two numbers are chosen independently and uniformly at random from the set {1, 2 , . . . , 13}. The probability (rounded off to 3 decimal places) that their 4-bit (unsigned) binary representations have the same most significant bit is Solution: The 4-bit binary representation of numbers (1, 2, 3, 4………13): 0  – […]

Two numbers are chosen independently and uniformly at random from the set {1, 2 , . . . , 13}. The probability (rounded off to 3 decimal places) that their 4-bit (unsigned) binary representations Read More »

An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random.

An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random.

Q. An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random. The probability that the pivot element gets placed in the worst possible location in the first round of partitioning (rounded off to 2 decimal places) is   Solution: Given an array of 25

An array of 25 distinct elements is to be sorted using quicksort. Assume that the pivot element is chosen uniformly at random. Read More »

Consider the grammar given below: Compute the FOLLOW set of the non-terminal B and write the index values for the symbols in the

Consider the grammar given below: S → Aa. Compute the FOLLOW set of the non-terminal B and write the index values for the symbols in the

Q. Consider the grammar given below: S → Aa A → BD B → b | ϵ D → d | ϵ Let a, b, d, and $ be indexed as follows: a b d $ 3 2 1 0 Compute the FOLLOW set of the non-terminal B and write the index values for the

Consider the grammar given below: S → Aa. Compute the FOLLOW set of the non-terminal B and write the index values for the symbols in the Read More »

For Σ = {𝑎, 𝑏}, let us consider the regular language 𝐿 = { 𝑥 |𝑥 = 𝑎2+3𝑘 or 𝑥 = 𝑏10+12𝑘, 𝑘 ≥ 0}. Which one of the following

For Σ = {𝑎, 𝑏}, let us consider the regular language 𝐿 = { 𝑥 |𝑥 = 𝑎2+3𝑘 or 𝑥 = 𝑏10+12𝑘, 𝑘 ≥ 0}. Which one of the following

Q. For Σ = {𝑎, 𝑏}, let us consider the regular language 𝐿 = { 𝑥 |𝑥 = 𝑎2+3𝑘 or 𝑥 = 𝑏10+12𝑘, 𝑘 ≥ 0}. Which one of the following can be a pumping length (the constant guaranteed by the pumping lemma) for 𝐿 ? (A) 3 (B) 5 (C) 9 (D) 24 Ans:

For Σ = {𝑎, 𝑏}, let us consider the regular language 𝐿 = { 𝑥 |𝑥 = 𝑎2+3𝑘 or 𝑥 = 𝑏10+12𝑘, 𝑘 ≥ 0}. Which one of the following Read More »

Which one of the following statements is NOT correct about the B+ tree data structure used for creating an index of a relational database table?

Which one of the following statements is NOT correct about the B+ tree data structure used for creating an index of a relational database table?

Q. Which one of the following statements is NOT correct about the B+ tree data structure used for creating an index of a relational database table? (A) B+ Tree is a height-balanced tree (B) Non-leaf nodes have pointers to data records (C) Key values in each node are kept in sorted order (D) Each leaf

Which one of the following statements is NOT correct about the B+ tree data structure used for creating an index of a relational database table? Read More »

Let 𝐺 be an undirected complete graph on 𝑛 vertices, where 𝑛 > 2. Then, the number of different Hamiltonian cycles in 𝐺 is equal to

Let 𝐺 be an undirected complete graph on 𝑛 vertices, where 𝑛 > 2. Then, the number of different Hamiltonian cycles in 𝐺 is equal to

Q. Let 𝐺 be an undirected complete graph on 𝑛 vertices, where 𝑛 > 2. Then, the number of different Hamiltonian cycles in 𝐺 is equal to Ans: Option D Solution: A simple circuit in a graph G that passes through every vertex exactly once is called a Hamiltonian circuit. In Hamiltonian cycle is a

Let 𝐺 be an undirected complete graph on 𝑛 vertices, where 𝑛 > 2. Then, the number of different Hamiltonian cycles in 𝐺 is equal to Read More »

Scroll to Top