1 votes 1 votes To find the kth smallest element in the heap , the time required is O(n), where k is less than the number of element in the heap. is this statement true should not it be O(klogn) DS data-structures binary-heap time-complexity + – Kaluti asked Nov 6, 2017 • recategorized Jul 7, 2022 by Lakshman Bhaiya Kaluti 326 views answer comment Share Follow See 1 comment See all 1 1 comment reply srestha commented Nov 6, 2017 reply Follow Share yes k time heapification needed 0 votes 0 votes Please log in or register to add a comment.
Best answer 1 votes 1 votes kth smallest element in max heap will take O(n) time as it will be one of the leaf nodes, kth smallest element in min heap will take O(1) time, i.e, O(klogk),which is a constant. phelps18 answered Nov 6, 2017 • selected Nov 6, 2017 by Kaluti phelps18 comment Share Follow See all 0 reply Please log in or register to add a comment.