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()

A 20 -> 40
B 20 -> 30 -> 40
C 10 -> 20 -> 40
D 10 -> 20 -> 30 -> 40
Practice Next

Hey! Ask a query