4 votes 4 votes If you are given a sorted list with n elements in ascending order. Then what will be the Time complexity to build a Min heap from the given array? DS data-structures binary-heap time-complexity + – Gaurab Ghosh asked Jan 18, 2017 • recategorized Jul 7, 2022 by Lakshman Bhaiya Gaurab Ghosh 1.5k views answer comment Share Follow See all 13 Comments See all 13 13 Comments reply Show 10 previous comments Tesla_fan commented Aug 26, 2017 reply Follow Share Even if we give input as sorted,how could a system wouldld check if the list is sorted or not so it's taking o(n). 0 votes 0 votes smsubham commented Dec 27, 2017 reply Follow Share @srestha If we are given that it is already sorted in descending order and in array form. isn't it already a min heap? Why do we need to check or call build heap? 0 votes 0 votes vamp_vaibhav commented Dec 27, 2017 reply Follow Share Isn't the question like.. You have given an array in ascending order.. What is the time complexity to check whether it is sorted or not? 0 votes 0 votes Please log in or register to add a comment.
–1 votes –1 votes see this http://www.geeksforgeeks.org/g-fact-85/ Bikram answered Jan 18, 2017 Bikram comment Share Follow See 1 comment See all 1 1 comment reply smsubham commented Dec 27, 2017 reply Follow Share If we are given that it is already sorted in descending order and in array form. isn't it already a min heap? Why do we need to check using heapify or call build heap? 0 votes 0 votes Please log in or register to add a comment.