Skip to content

Instantly share code, notes, and snippets.

View savarin's full-sized avatar

Ezzeri Esa savarin

  • San Francisco Bay Area
View GitHub Profile
"""Tic Tac Toe game consisting of (1) minimal logic to hold board state, and (2) wrapper to
improve user interface.
"""
from builtins import input
from builtins import object
from typing import List, Tuple, Optional
PRETTY_BOARD = """
a b c
@savarin
savarin / bplustree.py
Last active February 23, 2025 19:07
Python implementation of a B+ tree
"""Simple implementation of a B+ tree, a self-balancing tree data structure that (1) maintains sort
data order and (2) allows insertions and access in logarithmic time.
"""
class Node(object):
"""Base node object.
Each node stores keys and values. Keys are not unique to each value, and as such values are
stored as a list under each key.