- Create a doubly-linked list class that has a sentinel node. Name your
list class DList. The list should
be circular and should support the following operations:
- insertBefore(self, value, node): inserts the value before node
- append(self, value): appends the value to the list
- erase(self, node): removes the node from the list
- __iter__(self) a generator function that returns the next node in the list.
- find(self, value): returns the first node that contains the target value, or
None if the value is not in the list
- constructor should take a comparison function which returns true
if two values are equal and false otherwise
- Name the file dlist.py
- Put the file in a package named list. Importing * from the package
should import dlist.py. Remember you will need a __init__.py
file.
- DListDriver.py is a driver program that
you can use to test your program.