0 votes 0 votes Consider the array of size n. the first (n – 1) elements are already sorted. What is the worst case time complexity to insert a nth element in an array after insertion the array should be in sorted order?? Algorithms sorting time-complexity + – Anirban Biswas asked Dec 12, 2016 • edited Jun 29, 2022 by makhdoom ghaya Anirban Biswas 302 views answer comment Share Follow See 1 comment See all 1 1 comment reply Prashant. commented Dec 12, 2016 reply Follow Share Insertion sort O(n). But location can be find in O(logn) 3 votes 3 votes Please log in or register to add a comment.
1 votes 1 votes O(n) as it will take logn time to find the place of the value and in worst case O(n) time to insert the value. shayal chhabra answered Dec 12, 2016 shayal chhabra comment Share Follow See all 0 reply Please log in or register to add a comment.