MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / add_first

Method add_first

data_structures/linked_list/deque_doubly.py:89–94  ·  view source on GitHub ↗

insertion in the front >>> LinkedDeque().add_first('AV').first() 'AV'

(self, element)

Source from the content-addressed store, hash-verified

87 # DEque Insert Operations (At the front, At the end)
88
89 def add_first(self, element):
90 """insertion in the front
91 >>> LinkedDeque().add_first('AV').first()
92 'AV'
93 """
94 return self._insert(self._header, element, self._header._next)
95
96 def add_last(self, element):
97 """insertion in the end

Callers

nothing calls this directly

Calls 1

_insertMethod · 0.80

Tested by

no test coverage detected