(linkedlist)
| 88 | |
| 89 | # Helper function to caculate length of a linked list |
| 90 | def lengthOfLinkedlist(linkedlist): |
| 91 | length = 0 |
| 92 | current = linkedlist.head |
| 93 | while current != None: |
| 94 | length += 1 |
| 95 | current = current.next |
| 96 | return length |
| 97 | |
| 98 | |
| 99 | # Helper funtion to pad the list with zeros in front |