- Why not "the computer science"?
"computer science" is to be read as "[the field of] computer science." So, it's not referring to a specific instance of "computer science," but to the field as a whole.
- Why "the time complexity"? Without "time", would it still be "the complexity"?
We say "the time complexity" because we are referring to the specific time complexity of an algorithm, not time complexity as a concept. Without time, it would still be "the complexity" for the same reasons.
- Why "the amount of time"? Why not "the amount of the time"?
"amount of time" is considered its own phrase, with its own meaning. "the amount of the time" would mean something entirely different. Like the other explanations I've provided, that would imply we are referring to a specific instance of "time," when in reality, we want to refer to time as a concept/whole.
We say "the amount of time" to refer to this specific amount of time for the algorithm we are referring to.
- Why "the length of the string"?
Once again, it's all about referring to specific instances vs. general subjects. "the length of the string" should be interpreted as the specific length of the given string for this algorithm.
As a whole, just remember that the "the" article is used when you want to refer to something specific. Context is very important in deciding if the article should be used. The "the" article is dropped when referring to concepts as a whole, such as "computer science."