We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I think it is O(logN). Alternatively, you can use PriorityQueue, Implementation note from JavaDoc: this implementation provides O(log(n)) time for the enqueing and dequeing methods (offer, poll, remove() and add); linear time for the remove(Object) and contains(Object) methods; and constant time for the retrieval methods (peek, element, and size).
QHEAP1
You are viewing a single comment's thread. Return to all comments →
I think it is O(logN). Alternatively, you can use PriorityQueue, Implementation note from JavaDoc: this implementation provides O(log(n)) time for the enqueing and dequeing methods (offer, poll, remove() and add); linear time for the remove(Object) and contains(Object) methods; and constant time for the retrieval methods (peek, element, and size).