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

Relatively new to C++ but I am very interested in the algorithmic aspect of programming.

Is there a general framework for deciding if an algorithm is efficient? i.e. the quickest possible?

I am trying to write pseudocode on paper before implementing but there are probably many different ways to solve any given problem.

Would be very keen to learn best practice for constructing / analysing algorithms.

Thanks, and Happy New Year!

This question is related to c++ algorithm

The answer is


Yes you can start with the Wikipedia article explaining the Big O notation, which in a nutshell is a way of describing the "efficiency" (upper bound of complexity) of different type of algorithms. Or you can look at an earlier answer where this is explained in simple english