Projects/test_dbl_linked_list.py

16 lines
623 B
Python

import doubly_linked_class # Module
dll = doubly_linked_class.DoublyLinkedList() # Instantiate a doubly_linked list
dll.append((6, 8, 9, 0)) # Add the tuple as the first element
dll.prepend([6,7,8,9]) # Add list at the front of the list
dll.append({'Height': 68}) # Add dictionary at the end of the list
dll.insert_at_position(1, {8, 3, 5, 5}) # Add set of unique elements at index 1
dll.print_list() # Print the doubly_linked list
print(dll.search([6, 7, 8, 9])) # Return True if the data is an element of the linked list