Question
Consider a delete_node(head, key) function for a singly
linked list that removes the first occurrence of a node with a given key. The function works for most cases but throws a NullPointerException (or equivalent in other languages) when attempting to delete the last node in a list of two or more nodes. Which of the following is a common oversight that could lead to this specific bug?Solution
The correct answer is B
Average of present ages of A and B is 30 years. Ratio of age of A to age of B, after 10 years will be 7:9, respectively. What will be the ratio of their...
Ten years ago, the average age of five employees was 35 years. The present average age is 45 years after the inclusion of two new employees. Find the pr...
A’s age is 120% of what he was 4 years ago, But 30% of what it will be after 5 years. What is his present age?
The ratio of the present ages of father and his son is 5:2. The product of their ages 4 years ago was 31 times of his son’s age that year. What wa...
- The combined present ages of Veer and Raj are 48 years. In 4 years, their age ratio will be 1:3. What is the age difference?
Six years ago, the ratio of ages of Alok and Ravi was 7:9, respectively. Eight years hence, the ratio of ages of Rohan and Ravi will be 5:6, respectivel...
Ten years ago, the ratio of ages of Anil and Sunil was 1:2, respectively. Four years hence, the ratio of ages of Anil and Raj will be 3:4, respectively....
The present ages of 'Isha' and 'Riya' are in the ratio 5:6. Two years from now, Isha’s age will be 20% less than Riya’s age. What is Isha’s curren...
Present age of ‘A’ is 40% more than that of ‘B’. If 11 years hence from now, ‘B’ will be 5 years younger than ‘A’, then find the sum of ...
In four years, the age ratio of 'X' and 'Y' will be 10:13, respectively. The current average age of 'Y' and 'Z' is 54 years, and the present average age...