How one can define rigorously the time and space complexities of algorithms?

218 Views Asked by At

I would like to know the most rigorous definition of the time- or space complexity of algorithms. I mean for example Corman et al. uses notations like $n+O(n)$ which seems weird as $O(n)$ is defined to be a set in their book. The book "Asymptotic Analysis" by Murray uses functions in complex space but programmers are interested only non-negative integers. So what should a mathematician answer if some computer science student wants to ask rigorous way to do time- and space complexities of an algorithm? For example the Wikipedia site https://en.wikipedia.org/wiki/Big_O_notation writes "Let f be a real or complex valued function". Do we need to assume that algorithms use complex valued functions? How one can formalize the set of algorithms?