简体   繁体   中英

what is the time complexity for “public boolean add(E e)” of Class PriorityQueue<E>?

确切地说,我正在谈论: http : //docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html#add(E)

http://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html#add%28E%29

Implementation note: 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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM