In: Computer Science
What is the best running time taken to print the first character of a string of length n?
O(1)
O(log n)
O(n)
O(n log n)
O(n 2)
O(n k) where k is a constant > 2
O(2 n)
What is the best running time taken to print the letter 'A'.
O(1)
O(log n)
O(n)
O(n log n)
O(n 2)
O(n k) where k is a constant > 2
O(2 n)
What is the best running time taken to determine the smallest element in a unsorted array of length n? The array doesn't contain duplicates.
O(1)
O(log n)
O(n)
O(n log n)
O(n 2)
O(n k) where k is a constant > 2
O(2 n)
What is the best running time taken to determine if there is a specific value in a sorted array of length n? The array may contain duplicates.
O(1)
O(log n)
O(n)
O(n log n)
O(n 2)
O(n k) where k is a constant > 2
O(2 n)
I hope it'll clear all your doubts in this question. Support us by pressing that upvote button.