Added sample program with imported doubly_linked_list module

This commit is contained in:
Donald Calloway 2025-10-09 10:46:21 -07:00
parent e4a4cae418
commit c4625a1bc4

15
test_dbl_linked_list.py Normal file
View File

@ -0,0 +1,15 @@
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