[c++] How can I tell if an algorithm is efficient?