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

Class Node

data_structures/linked_list/from_sequence.py:7–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5
6
7class Node:
8 def __init__(self, data=None):
9 self.data = data
10 self.next = None
11
12 def __repr__(self):
13 """Returns a visual representation of the node and all its following nodes."""
14 string_rep = ""
15 temp = self
16 while temp:
17 string_rep += f"<{temp.data}> ---> "
18 temp = temp.next
19 string_rep += "<END>"
20 return string_rep
21
22
23def make_linked_list(elements_list: list | tuple) -> Node:

Callers 1

make_linked_listFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected