Skip to content

Instantly share code, notes, and snippets.

View Iiridayn's full-sized avatar

Michael Clark Iiridayn

View GitHub Profile
@Iiridayn
Iiridayn / perf.py
Last active January 29, 2025 05:16
Python timings of linked list vs Python list operations
class Link:
"""A linked list."""
empty = ()
def __init__(self, first, rest=empty):
assert rest is Link.empty or isinstance(rest, Link)
self.first = first
self.rest = rest
def link_insert_head(r):