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
5 years ago, A was 1/3 of B’s age. If the ratio of their present ages is 2:5, what will be the sum of their present ages?
Present average age of A, B and C together is 44 years. Age of B is 12 Years hence from now will be 260% more than age of A, Four years ago from now whi...
What will be the 11th term of the arithmetic progression 3, 8, 13, _____?
The marks obtained by 12 students out of a maximum of 30 in a test are given as 25, 28, 24, 22, 25, 18, 20, 22, 19, 23, 22, and 26. Find the sum of the ...
The interest earned when a sum is invested at simple interest of 20% p.a., for 3 years, is Rs. 3000. What will be the total amount received after 2 year...
In an arithmetic progression, the 4th term is 23 and the 9th term is 48. What is the sum of the first 20 terms?
The sum of first 'n' natural numbers is 465. Find 'n'.
nth term of an AP is 0. If AP is 63, 60, 57…, then find the value of n.
You are provided with three sequences below. Determine the values of P, Q, and R, and then identify the relationship among them.<...
If the sum of n numbers in the GP 3, 6, 12, ... is 765 then n is?