<jupyter_start><jupyter_text>The singley linked list is a generic data structure.  Many other data structures are based on the single linked list.Traversal of a linked list occurs by starting on the head node and then moving to the next node as long as the next node is not None. ADT: ```head() -> Node : The first node in the list.next() -> Node : The next node referenced from the current node.  Will be None if on last node.addNode() -> bool : Returns bool indicating success or failure. Node will be added to the front.```<jupyter_code># Python definition
import typing
class Node(object):
    def __init__(self, data: any, next = None):
        self.data = data
        self.next = None

# Helper object which maintains references.
class SinglyLinkedList(object):
    def __init__(self, head: Node):
        self.head = head


# Usage
n1 = Node(5)
n2 = Node(6)
n3 = Node(7)

n1.next = n2
n2.next = n3<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08663101604278074, 'fraction_numerical': 0.0106951871657754, 'mean_word_length': 3.727272727272727, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '307294', 'license': 'MIT', 'n_tokens_mistral': 282, 'n_tokens_neox': 276, 'n_words': 126, 'path': 'code/dataStructuresAndAlgorithms/dataStructures/lists/singleyLinkedList/singlyLinkedList.ipynb', 'repo_name': 'minoad/lonestarDadsCode', 'size': '935'}