I am a sophomore taking a course in algorithm analysis. We were asked by our professor to calculate time-complexity of several C functions, but some of them were incorrect and would result in a compile error. As far as I know time complexities of correct algorithms are calculated and then we choose which one to implement. We tried to discuss this with her but she insisted on solving those problems nevertheless stating that it doesn't matter whether the code gets executed or not.
Is there a way one can realise that the algorithm is incorrect after finding it's time complexity?
Does it make sense calculating time complexity for an incorrect program?
PS :
1) The program wasn't implementing any proven algorithms, it was just some loops.
2) This may sound like a silly question, but my professor got me confused.
Downvotes are welcome but please give your opinion.