gate questions
Let Σ be the set of all bijections from {1, … , 5} to {1, … , 5}, where 𝑖𝑑 denotes the identity function, i.e. 𝑖𝑑(𝑗) = 𝑗, ∀𝑗.  Let ∘ denote composition on functions

Q. Let Σ be the set of all bijections from {1, … , 5} to {1, … , 5}, where 𝑖𝑑 denotes the identity function, i.e. 𝑖𝑑(𝑗) = 𝑗, ∀𝑗.  Let ∘ denote composition on functions.   For a string 𝑥 =𝑥1 𝑥2 ⋯ 𝑥𝑛 ∈ Σ𝑛, 𝑛 ≥ 0 , let 𝜋(𝑥) = 𝑥1 ∘ 𝑥2 ∘ ⋯ ∘ 𝑥𝑛. Consider the language 𝐿 = {𝑥 ∈ Σ∗| 𝜋(𝑥) = 𝑖𝑑 }. The ...

READ MORE +
Let 𝑇 be a full binary tree with 8 leaves. (A full binary tree has every level full.) Suppose two leaves 𝑎 and 𝑏 of 𝑇 are chosen uniformly and independently at random

Q. Let 𝑇 be a full binary tree with 8 leaves. (A full binary tree has every level full.) Suppose two leaves 𝑎 and 𝑏 of 𝑇 are chosen uniformly and independently at random. The expected value of the distance between 𝑎 and 𝑏 in 𝑇 (i.e., the number of edges in the unique path between 𝑎 and 𝑏) is ...

READ MORE +
Consider the following statements

Q. Consider the following statements: The smallest element in a max-heap is always at a leaf node The second largest element in a max-heap is always a child of the root node A max-heap can be constructed from a binary search tree in Θ(𝑛) time A binary search tree can be constructed ...

READ MORE +
Let 𝐺 be any connected, weighted, undirected graph.

Q. Let 𝐺 be any connected, weighted, undirected graph. 𝐺 has a unique minimum spanning tree, if no two edges of 𝐺 have the same weight. 𝐺 has a unique minimum spanning tree, if, for every cut of 𝐺, there is a unique minimum-weight edge crossing the cut. Which of the above two statements ...

READ MORE +
There are n unsorted arrays: A1, A2, …, An. Assume that n is odd. Each of A1, A2, …, An contains n distinct elements. There are no common elements between any two arrays

Q. There are n unsorted arrays: A1, A2, …, An. Assume that n is odd. Each of A1, A2, …, An contains n distinct elements. There are no common elements between any two arrays. The worst-case time complexity of computing the median of the medians of A1, A2, …, An is (A) O(n) (B) O(n log n) ...

READ MORE +
Gkseries.com
Logo
Register New Account