can't we introduce some more variables in the algorithm itself and find the complexity the same way we do it manually.
like for example we can have a variable in an insertion sort say n=0 which keeps the track of the entire looping part of the algorithm and then give the answer as O(n^2)