python-ai /

Filename Size Date modified Message
29 B
1017 B


Copyright (C) 2012 Geoff Hill, Nicholas Lau. All rights reserved.

A Python implementation of the assignments for EECS 348 Introduction to Artificial Intelligence, taught by Doug Downey in Spring 2012.


A red-black tree implementation in Python.

Features: - Written in idiomatic Python: * Uses magic methods for comparison, indexing, length. * Provides iterators for traversing in both directions. - Exposes 3 slightly different tree classes: * Tree (non-associative, contains duplicates) * TreeSet (non-associative, no duplicates) * TreeMap (associative) - Designed for high performance: * Self-balancing, ensuring a height of at most twice the optimal. * Element counts cached for O(1) calls to len(). * O(log n) retrieval and updates. - Well-tested: * Correctness tests with full branch and requirements coverage. * Stochastic speed tests with diagnostic output.