UGC NET Paper 2 (Computer Science)Hard
The information-theoretic lower bound on the number of comparisons needed to sort 5 distinct elements is:
- A. 7
- B. 8
- C. 5
- D. 10
Correct answer: A. 7
ceil(log2 5!) = ceil(log2 120) = 7, the decision tree needs at least 120 leaves.
Practise more UGC NET Computer Science and Applications questionsUGC NET Computer Science and Applications: notes and key points
More UGC NET Computer Science and Applications questions
- Consider. I. Kruskal's algorithm runs in O(E log E) with sorting. II. Prim's algorithm with a binary heap runs in O(E log V). III…
- Matrices A (10x20), B (20x30), C (30x40) are to be multiplied. The minimum number of scalar multiplications is:
- For symbol frequencies 5, 9, 12, 13, 16, 45 a Huffman code has a total weighted path length (encoded bits) of:
- A full binary tree (each node has 0 or 2 children) has 25 leaves. The total number of nodes is:
- The maximum number of edges in a simple planar graph with 10 vertices is:
- The number of generators of the cyclic group Z12 is: