Search for question
Question

For each of these questions, answer yes or no and briefly explain your answer. A. If an algorithm takes O(n²) worst-case time, is it possible that it takes O(n) on some inputs? B. If an algorithm takes O(n²) worst-case time, is it possible that it takes O(n) on all inputs? C. If an algorithm takes (n²) worst-case time, is it possible that it takes O(n) on some inputs? D. If an algorithm takes (n²) worst-case time, is it possible that it takes O(n) on all inputs?

Fig: 1

Fig: 2

Fig: 3

Fig: 4

Fig: 5