I was solving a problem on leetcode and someone told me that instantiation of a PriorityQueue with a collection takes O(n) time and the addAll method takes O(nlogn) time. Is this correct? I could not find any proofs for this.
https://www.techiedelight.com/find-kth-largest-element-array/ this website on the 3rd approach uses addAll(List) to create a PriorityQueue is it really O(n)?