Data-Structures-and-Algorithms
Data-Structures-and-Algorithms copied to clipboard
fix to DoublyLinkedList.InsertFirst()
The InsertFirst() method is missing an empty list check. I copied the check from InsertLast() and made the needed changes. This fix is the following 5 lines of code:
if list.tail == nil {
list.head = data
list.tail = data
return
}