Transcript from the "Big O: Property Lookup" Lesson
>> Speaker 1: So what is n in this case?
>> Speaker 1: What is the, so n in this case is the length of the string. Then the time complexity is going to be as the string gets longer, how much more work do we need to do?
>> Speaker 1: So when the string is length five, how much work does this expression have to do?
>> Speaker 2: But didn't you say return is always gonna be constant?
>> Speaker 1: Well, the return but what about this?
>> Laney: Well how does it get the length?
>> Speaker 1: Yeah, exactly, Laney. That's the exact point. How does it get the length? We need to understand the length property. So if the length property looped through the length of a string and counted from 0 to n, that would be a linear operation.
>> Speaker 1: And as a result this will always be a constant time algorithm.
>> Speaker 1: Which means if our string length was 1 million it wouldn't be any slower than if it was just 1.
>> Speaker 2: Cuz it already knows that.
>> Speaker 1: Yeah, exactly, it doesn't matter.