Question
A 7-digit number ‘538p7q2’ is divisible by 24.
Determine the minimum possible value of (p × q).Solution
ATQ,
‘538p7q2’ is divisible by 24.
So, it must be divisible by both ‘3’ and ‘8’.
Divisibility by ‘8’: Last three digits must be divisible by ‘8’.
Divisibility by ‘3’: Sum of the digits of the number must be divisible by ‘3’.
So, 7q2 has to be divisible by 8.
Possible values for q = 1, 5, 9
Again, for the number to be divisible by 3,
(5 + 3 + 8 + p + 7 + q + 2) = (25 + p + q) has to be divisible by 3.
If q = 1, then (26 + p) will be divisible by 3 if p = 1, 4, 7
If q = 5, then (30 + p) will be divisible by 3 if p = 0, 3, 6, 9
If q = 9, then (34 + p) will be divisible by 3 if p = 2, 5, 8
Minimum value of (p × q) from all the combinations = 1 × 1 = 1
Which data structure is typically used to implement Breadth-First Search (BFS)?
In a binary tree, if the number of leaf nodes is L, what is the number of nodes with two children?
Which of the following sorting algorithms is a non-comparison-based sort?
Dynamic Programming is useful when a problem has:
Recursive problems are implemented by
In a binary search tree (BST), what is true about the left child of a node?
Which is not true about minimum spanning tree?
In Data Communication, what protocol is used to ensure reliable transmission of data over a network?
A unique piece of information that is used in encryption.
What is the space complexity of Bubble Sort?