data structure for redblack tree and first top coder solution.