Question on the Big-O runtime efficiency
Need some help with these problems
Assume T(n) is a count of the number of key operations for an algorithm that processes a list of n elements. Determine the Big-O runtime efficiency of the algorithm.
T(n) = O(1) is there an answer for this?? nothing to solve?
T(n) = O(n) is there an answer for this?? nothing to solve?
Indicate the running time of each algorithm or code segment.
Outputting the first and last letter in a string: (i) O(n2), (ii) O(n), (iii) O(1), (iv) O(log2 n)?
Determining the number of tokens (blocks of nonwhitespace characters) in a string: (i) O(n2), (ii) O(n), (iii) O(1), (iv) O(log2 n) ?