Title basically, can we design a program that inputs another code file, say for example a Python program, and can tell you its time complexity?
The program can read the program word for word and indent for indent, and can count how many for
or while
statements it encounters. It can then see if they are nested for quadratic time. I feel like it's not like the Halting problem, since we're not looking to see if it will end, just its time complexity. But, what about algorithms that implement recursion? Would such a program be possible to write still?
Sorry if this seems like a silly questions, I was pondering this and was thinking of trying to write it myself.