Optimize RMQ and LCA structs