(self, v)
| 86 | |
| 87 | #method to delete a specific element |
| 88 | def delete(self, v): |
| 89 | if self.isEmpty(): |
| 90 | return |
| 91 | temp = self.head |
| 92 | if temp.data == v: |
| 93 | self.head = temp.next |
| 94 | temp = None |
| 95 | return |
| 96 | else: |
| 97 | while temp.next != None: |
| 98 | if temp.data == v: |
| 99 | break |
| 100 | temp = temp.next |
| 101 | if temp.next == None: |
| 102 | return |
| 103 | temp.data = None |
| 104 | if temp.next != None: |
| 105 | temp.data = temp.next.data |
| 106 | temp.next = temp.next.next |
| 107 | |
| 108 | #meethod to display the nodes of the list |
| 109 | def display(self): |
no test coverage detected