'For which values of k are O(n+k) and O(n+k*logk) linear?

How would i go about finding these values? The time complexities are both related to sorting algorithms. In both cases, k represents the number of different elements in the list to be sorted. Intuitively we should have linear O(n) time if k is small relative to n in both cases but is there a more strict set of values?

In the case of O(n+k), I tried by simply assumning that k has to be O(n) but i have a hard time defining exatly what that would mean. For example if n=100 and k=200, I assume that would be linear time since k is O(n) but if k=10000 we would say its O(n^2). Where would the limit for linear time be?

I would appreciate any help, Thanks in advance



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source