What do we mean by running time of algorithms? when we say running time of bubble sort is O($n^2$), what are we implying? Is it possible to find the approximate time in minutes/seconds from the asymptotic complexity of the algorithm? If so, how ?
What do we mean by running time of algorithms?
Depends on who is talking. It can mean everything from actual time in seconds to execution count of some asymptotically dominant instruction. Things get muddied further by widespread overuse of Landau notation.
Also, one typically distinguishes at least worst, average and best case.
when we say running time of bubble sort is $O(n^2)$, what are we implying?
Here we use that the actual running time is in $\Theta$ of the execution count of an asymptotically dominant operation. We can rigorously show that Bubblesort takes $\Theta(n^2)$ comparisons (in fact, we can get the exact number for worst-, best- and average case), that all other operations happen only $O(n^2)$ often, and thus the real running-time has to be in $\Theta(n^2)$ as well.
That assumes that our machine model (usually RAM) and the real machine differ only by constant factors (unknown to us). If you analyzed formally on the TM model, you could not carry over Landau bounds as easily. In general, converting between (reasonable) models can add a polynomial factor.
Is it possible to find the approximate time in minutes/seconds from the asymptotic complexity of the algorithm?
No, not at all. Assuming that by "asymptotic complexity" you mean a Landau bound on the runtime function $T$,
- you only know the behaviour of T for $n \geq n_0$ for some $n_0$ that may be larger than anything you ever see in inputs;
- you only know the behaviour up to a constant factor $c$;
- you only know the type/degree of the leading terms but lower terms can be significant (i.e. the absolute error of your bound can tend to infinity, even if you have a tight estimate of the constant factor of the leading term).
Even if you knew $n_0$, lower-order terms and all constant factors,
- these bounds are usually not tight and
- the analysis gives you the execution of some operations, not actual time.
The only way to use formal analysis for predicting actual running times is
- analysing the execution counts for all statements,
- analysing up up to small error terms, and
- know how many (nano)seconds each statement takes.
Sometimes we can do 1. and 2. but 3. is very, very tough for real machines -- which is why everybody in TCS analyses on clean machine models.
Asymptotic complexity is not used to find actual running times of algorithms but as a comparison tool to find out which algorithm is more efficient. When you say $Algorithm_1$ is O(nlogn) as opposed to $Algorithm_2$ which is O($n^2$) you simply mean $Algorithm_1$ is a better algorithm in terms of run time complexity.
Now coming to your question about finding actual time taken here's a possible solution.
Say your algorithm's running time is approximated as a function of the form T(n)=a$n^2$, now you know beforehand that T(100)=10 seconds. Hence you substitute T(100) and get $a*10000=10$, or $a=1/1000$.
Now you want to find out the running time when the i/p size is 200(say). You just substitute 200 in T(n)=$1/1000$*$a^2$ and get the required time in seconds.