Write a function that takes a doubly linked list and creates an equivalent singly linked list.
SinglyLinkedList doubleToSingle(DoublyLinkedList DL){ The while loop executes \( n \) times as \( removeLast() \) takes \( O(1) \) time on a doubly linkedlist, but \( O(n) \) time on a singly linkedlist. \( \therefore \) Running time = \( O(n) \). |