Skip to content

Instantly share code, notes, and snippets.

View Thodoris-Evangelakos's full-sized avatar
🎯
Focusing

Thodoris Evangelakos Thodoris-Evangelakos

🎯
Focusing
  • Chania, Crete
  • 07:07 (UTC +03:00)
  • Instagram tevangel14
View GitHub Profile
@Thodoris-Evangelakos
Thodoris-Evangelakos / btree.py
Last active June 9, 2022 23:12
A modification of Martin Thoma's in-memory python b-tree, altered to work with python 3
import bisect
import itertools
import operator
class _BNode(object):
__slots__ = ["tree", "contents", "children"]
def __init__(self, tree, contents=None, children=None):
self.tree = tree
self.contents = contents or []