MCPcopy Create free account
hub / github.com/careercup/ctci / padInFront

Function padInFront

python/Chapter 2/Question2_5.py:100–105  ·  view source on GitHub ↗
(linkedlist, number)

Source from the content-addressed store, hash-verified

98
99# Helper funtion to pad the list with zeros in front
100def padInFront(linkedlist, number):
101 padlist = LinkedList()
102 padlist.head = linkedlist.head
103 for i in range(number):
104 addNodeInFront(padlist, 0)
105 return padlist
106
107
108

Callers 1

addLists_fwd_2Function · 0.85

Calls 2

addNodeInFrontFunction · 0.85
LinkedListClass · 0.50

Tested by

no test coverage detected