educative.io

Wrong statement for time complexity

The time complexity of creating a heap is O(n) and removing min is O(klogn). So the total time complexity is O(n+klogn) which is basically O(klogn).

This statement seems to be wrong, time complexity should be O(n) not O(klogn). Can you please
confirm and fix?

When time complexities are added, you basically ignore the smaller ones. In this case, O(n) is more efficient (or smaller), than O(klogn), therefore, it is ignored.

O(1) < O(logn) < O(n) < O(nlogn)