Implement constant-time table lookup