Á Ánh Dương New member Sep 21, 2021 #1 What is the worst case time complexity of gnome sort? A. O B. O(n$^{2}$) C. O(n log n) D. O(log n)
T Thanh Thảo New member Sep 21, 2021 #2 Answer: b Explanation: Worst case occurs when the input array is reverse sorted as it will have the maximum number of decrements while sorting. This causes the algorithm to have a time complexity of O(n$^{2}$) in this case. Upvote 0 Downvote
Answer: b Explanation: Worst case occurs when the input array is reverse sorted as it will have the maximum number of decrements while sorting. This causes the algorithm to have a time complexity of O(n$^{2}$) in this case.