Question
Ratio of present age of 'A' to that of 'B' is 4:7. If
the age of 'B' three years hence from now will be 31 years, then after how many years, the ratio of the age of 'B' to that of 'A' will become 5:4?Solution
Let the present ages of 'A' and 'B' be '4m' and '7m' years respectively.
So, 7m + 3 = 31
Or, 7m = 28
So, 'm' = 4
Present age of 'A' = 4m = 16 years
Present age of 'B' = 7m = 28 years
Let ratio of the ages of 'B' to 'A' becomes 5:4 after 'n' years.
So, (16 + n) : (28 + n) = 4 : 5
Or, 5 × (16 + n) = 4 × (28 + n)
Or, 80 + 5n = 112 + 4n
So, 'n' = 32
Hence, option D.
Which data structure is used in recursion?
An algorithm with a time complexity of O(log n) means that its execution time:
Which of the following is a key principle of the SOLID design principles that focuses on ensuring a class has only one reason to change?
What is the time complexity of searching an element in a balanced binary search tree (BST) with nnn nodes?
What is the time complexity of searching for an element in a sorted array using binary search?
 Which graph traversal algorithm uses a queue to explore vertices in a layer-by-layer fashion?
Which data structure is used for undo operations in text editors?
What is the worst-case time complexity for inserting an element into a hash table that uses separate chaining for collision resolution?
Given a singly linked list with 'n' nodes, what is the time complexity to delete the last node?
A binary search tree (BST) property states that for any given node: