Added sample program with imported doubly_linked_list module
This commit is contained in:
parent
e4a4cae418
commit
c4625a1bc4
15
test_dbl_linked_list.py
Normal file
15
test_dbl_linked_list.py
Normal 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
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user