MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / add

Method add

other/lru_cache.py:112–125  ·  view source on GitHub ↗

Adds the given node to the end of the list (before rear)

(self, node: DoubleLinkedListNode[T, U])

Source from the content-addressed store, hash-verified

110 return ",\n ".join(rep)
111
112 def add(self, node: DoubleLinkedListNode[T, U]) -> None:
113 """
114 Adds the given node to the end of the list (before rear)
115 """
116
117 previous = self.rear.prev
118
119 # All nodes other than self.head are guaranteed to have non-None previous
120 assert previous is not None
121
122 previous.next = node
123 node.prev = previous
124 self.rear.prev = node
125 node.next = self.rear
126
127 def remove(
128 self, node: DoubleLinkedListNode[T, U]

Callers 15

mine_treeFunction · 0.45
lstm_prediction.pyFile · 0.45
is_pangramFunction · 0.45
refreshMethod · 0.45
hill_climbingFunction · 0.45
is_happy_numberFunction · 0.45
kruskalMethod · 0.45
dfsFunction · 0.45
bfsFunction · 0.45

Calls

no outgoing calls

Tested by 5

bfs_shortest_pathFunction · 0.36
breath_first_searchMethod · 0.36
test_additionFunction · 0.36
test_multiplicationFunction · 0.36