(self)
| 107 | |
| 108 | #meethod to display the nodes of the list |
| 109 | def display(self): |
| 110 | temp = self.head |
| 111 | if self.isEmpty(): |
| 112 | print("List is Empty") |
| 113 | return |
| 114 | print("head -> ", end = " ") |
| 115 | while (temp.next != None): |
| 116 | print(temp.data, end = " -> ") |
| 117 | temp = temp.next |
| 118 | print(temp.data, " <- tail") |
| 119 | |
| 120 | n = SinglyLinkedList() |
| 121 | n.addFront(3) |
no test coverage detected