Linked List in Python [Notes]

Aaliyah.S
2 min readNov 23, 2022

Trying to understand Linked List from an undergrads perspective…

So what is a Linked List?
• A linked list is a linear collection of data elements, called nodes, each pointing to the next node by means of a pointer.

#linked list by constructor.

empty = []
def is_link(s):
return s == empty or (len(s) == 2 and is_link(s[1]))
def link(first, rest):
assert is_link(rest), "rest must be a linked list."
return [first, rest]
#Representation in Python using…

--

--

Aaliyah.S

Just a passionate author, poet, scriptwriter and blogger who wants to change the world with her words. Oh, and a cat lover too!