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

Method __repr__

other/lfu_cache.py:105–112  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

103 self.head.next, self.rear.prev = self.rear, self.head
104
105 def __repr__(self) -> str:
106 rep = ["DoubleLinkedList"]
107 node = self.head
108 while node.next is not None:
109 rep.append(str(node))
110 node = node.next
111 rep.append(str(self.rear))
112 return ",\n ".join(rep)
113
114 def add(self, node: DoubleLinkedListNode[T, U]) -> None:
115 """

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected