in reply to Advanced Data Structure Question

DB_File's $DB_BTREE database should be a quick way to get a binary tree up and running. You can create the database in-memory, which is likely to be pretty fast.