gate questions

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 Β»

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 Β»

Let 𝐺 be an arbitrary group. Consider the following relations on 𝐺

Let 𝐺 be an arbitrary group. Consider the following relations on 𝐺

Q. Let 𝐺 be an arbitrary group. Consider the following relations on 𝐺: 𝑅1: βˆ€π‘Ž, 𝑏 ∈ 𝐺, π‘Ž 𝑅1𝑏 if and only if βˆƒπ‘” ∈ 𝐺 such that π‘Ž = π‘”βˆ’1𝑏𝑔 𝑅2: βˆ€π‘Ž, 𝑏 ∈ 𝐺, π‘Ž 𝑅2𝑏 if and only if π‘Ž = π‘βˆ’1 Which of the above is/are equivalence relation/relations? (A) 𝑅1

Let 𝐺 be an arbitrary group. Consider the following relations on 𝐺 Read More »

Consider Z = X – Y, where X, Y and Z are all in sign-magnitude form. X and Y are each represented in 𝑛 bits. To avoid overflow, the representation of Z would require a minimum of

Consider Z = X – Y, where X, Y and Z are all in sign-magnitude form. X and Y are each represented in 𝑛 bits. To avoid overflow, the representation of Z would require a minimum of

Q. Consider Z = X – Y, where X, Y and Z are all in sign-magnitude form. X and Y are each represented in 𝑛 bits. To avoid overflow, the representation of Z would require a minimum of: (A) 𝑛 bits (B) 𝑛 βˆ’ 1 bits (C) 𝑛 + 1 bits (D) 𝑛 + 2

Consider Z = X – Y, where X, Y and Z are all in sign-magnitude form. X and Y are each represented in 𝑛 bits. To avoid overflow, the representation of Z would require a minimum of Read More Β»

If 𝐿 is a regular language over Ξ£ = {π‘Ž, 𝑏}, which one of the following languages is NOT regular ?

If 𝐿 is a regular language over Ξ£ = {π‘Ž, 𝑏}, which one of the following languages is NOT regular ?

Q. If 𝐿 is a regular language over Ξ£ = {π‘Ž, 𝑏}, which one of the following languages is NOT regular ? (A) 𝐿 β‹… 𝐿𝑅 = {π‘₯𝑦 | π‘₯ ∈ 𝐿, 𝑦𝑅 ∈ 𝐿} (B) {𝑀𝑀𝑅 | 𝑀 ∈ 𝐿} (C) Prefix (𝐿) = {π‘₯ ∈ π›΄βˆ—|βˆƒπ‘¦ ∈ π›΄βˆ— such that π‘₯𝑦 ∈ 𝐿}

If 𝐿 is a regular language over Ξ£ = {π‘Ž, 𝑏}, which one of the following languages is NOT regular ? Read More Β»

Scroll to Top