<jupyter_start><jupyter_text>Implementation of Singly Linked List<jupyter_code>class Node(object):

    def __init__(self,value):
        self.value = value
        self.nextnode = None
a = Node(1)
b = Node(2)
c = Node(3)
a.nextnode = b
b.nextnode = c<jupyter_output><empty_output><jupyter_text>ProsLinked Lists have constant-time insertions and deletions in any position, in comparison, arrays require O(n) time to do the same thing.Linked lists can continue to expand without having to specify their size ahead of time (remember our lectures on Array sizing form the Array Sequence section of the course!) ConsTo access an element in a linked list, you need to take O(k) time to go from the head of the list to the kth element. In contrast, arrays have constant time operations to access elements in an array.<jupyter_code>class Node2(object):
    def __init__(self,element):
        self.element = element
        self.nextnode2 = None

d = Node2(4)
e = Node2(5)
f = Node2(6)
g = Node2("Hello")
d.nextnode2 = e
e.nextnode2 = f
f.nextnode2 = g
a.value
g.element
a.nextnode.value
e.nextnode2.element
f.nextnode2.element
e.nextnode2.nextnode2.element<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08389830508474576, 'fraction_numerical': 0.016101694915254237, 'mean_word_length': 4.41743119266055, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '19711', 'license': 'CC0-1.0', 'n_tokens_mistral': 384, 'n_tokens_neox': 376, 'n_words': 136, 'path': 'DS_Algo/Linked List/Single_LL.ipynb', 'repo_name': 'ShivamBhosale/100DaysOfCode_V2', 'size': '1180'}