(self)
| 19 | |
| 20 | #method to count thee no. of nodes in the list |
| 21 | def count(self): |
| 22 | if self.isEmpty(): |
| 23 | return 0 |
| 24 | n = 0 |
| 25 | temp = self.head |
| 26 | while (temp != None): |
| 27 | n += 1 |
| 28 | temp = temp.next |
| 29 | return n |
| 30 | |
| 31 | #method to add an element in the front i.e. head |
| 32 | def addFront(self, x): |