This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_linked_list_better(input_list): | |
head = None | |
tail = None | |
for value in input_list: | |
if head is None: | |
head = Node(value) | |
tail = head # when we only have 1 node, head and tail refer to the same node |