Computer Science EngineeringVery hard
What is the minimum number of coins needed to make 11 using denominations {1, 5, 6, 9}?
- A. 3
- B. 2
- C. 4
- D. 1
Correct answer: B. 2
Coins 5 and 6 sum to 11, so two coins suffice, while greedy picking 9 would need three.
Practise more Algorithms, Data Structures & Programming (ISRO CS) questionsAlgorithms, Data Structures & Programming (ISRO CS): notes and key points
More Algorithms, Data Structures & Programming (ISRO CS) questions
- Huffman coding is applied to frequencies 5, 9, 12, 13, 16, 45. What is the total weighted path length (sum of internal node weights)?
- What is the Theta bound of: for(i=1;i<=n;i++) for(j=1;j<=n;j=2) count++;
- An adjacency matrix representation of a graph with V vertices needs space
- Which hashing technique guarantees O(1) worst-case search time for a static set of keys?
- A singly linked list holds 1->2->3->4->5. After: p=head; while(p->next && p->next->next) p=p->next->next; what is p->data?
- The number of leaf nodes in a perfect binary tree of height 5 (root at height 0) is