Suppose I have two algorithms A()and B()for which the algorithm A()accepts exactly O(3n^2)while the algorithm B()accepts O(n^2). Although both algorithms work in quadratic time, can we say that algorithm B is faster than?
I understand that we ignore constants when analyzing the running time of an algorithm, but I want to ask about this case when we need to consider constants when analyzing algorithms.
thank
source
share