Annoucements #
New webcam usage survey
Exercise solutions:
Runtime analysis cont. #
Space complexity analysis #
1MB) kB
Strings have the fields: start address, length, offset, hash
For example:
str = "Java";
str1);
The space is constant because the sub string isn’t copied, just more references are made.
- c + 4n, so O(n)
- 32 + 64n)
Normally you don’t count the space of the parameters or the return.
Time complexity is O(n) Space complexity is O(1)