0 0 votes IN THE VIA HEAP LIST WHY IT IS O(LOGN) FOR SEARCHING?? Data Structures + – eyeamgj 2.7k views answer comment Share Follow Print See all 25 Comments 25 25 Comments reply Show 22 previous comments Gupta731 commented Dec 24, 2018 reply Follow flag Sorry, but all these days I have studied and told by the faculties that heap is an efficient way to implement a priority queue. Even it is mentioned in wiki. This answer is conflicting with my concepts. How a sorted array is better for a priority queue? 0 0 replyShare Shaik Masthan commented Dec 24, 2018 reply Follow flag Insertion, Deletion and Searching respectively, SORTED ARRAY :- O(n),O(1) and O(log n) Heaps :- O(log n), O(log n) and O(n) clearly we can observe in one operation, O(1) is better choice than O(log n). 1 1 replyShare Gupta731 commented Dec 25, 2018 reply Follow flag Got it, Thanks 0 0 replyShare Please log in or register to add a comment.