Skip to content

Instantly share code, notes, and snippets.

@emil-raubach
emil-raubach / sllist.py
Created February 17, 2019 04:39
My implementation of the Single Linked List Data Structure
# class for elements in a single linked list
class SingleLinkedListNode(object):
def __init__(self, value, nxt):
self.value = value
self.next = nxt
def __repr__(self):
nval = self.next and self.next.value or None
return f"[{self.value}:{repr(nval)}]"