Question
Given the `SinglyLinkedList` and its `delete_node`
method as provided, what will be the output of `my_list.print_list()` after the following sequence of operations? my_list = SinglyLinkedList() my_list.append(10) my_list.append(20) my_list.append(30) my_list.append(40) my_list.delete_node(10) my_list.delete_node(30) my_list.print_list()Solution
Deleting 10 (head) works correctly, making the list 20 -> 30 -> 40. Attempting to delete 30 (non-head) triggers the error, and the prev.next pointer (from 20 to 30) is not updated. The list remains 20 -> 30 -> 40.
Find the HCF of two numbers if LCM and product of those two numbers are 45 and 630 respectively.
The LCM of two natural numbers is 8 times their HCF. If the product of given two numbers is 1152, then find the LCM of the numbers.Â
The HCF of two numbers is 6 and their LCM is 180. If one number is 30, find the other number.
Find the greatest 4-digit number which is exactly divisible by both 15 and 21.
The HCF and LCM of two natural numbers are 10 and 60, respectively. What is the difference between the two numbers, if one of the numbers is 30?
Find the HCF of two numbers if LCM and product of those two numbers are 15 and 675 respectively.
What is the HCF of  (x4  - x2  - 6)   and  (x4  - 4x2  + 3) ?
(a)Â x2 Â - 3Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (b)...
The greatest number of four digits which when divided by 9, 12, 15 leave remainders 6, 9, 12 respectively is:
Which of the following numbers is divisible by 11?