Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 431 Bytes

README.markdown

File metadata and controls

23 lines (15 loc) · 431 Bytes

pyavl

An implementation of AVL trees in Python. Handles duplicate items. Works on any datatype for which comparison operators are defined (tested on strings and numbers)

To run tests:

python path/to/pyavlTests.py

To use:

from pyavl import AvlTree

b = AvlTree()

b.insert(5)
b.insertAll([5,3,4])
b.contains(10)
b.delete(3)

for x in b:
    # iterator yields items in ascending sorted order