Need Help | C++ | Custom Comparator functions

Hi everyone,

Wanted a little help with something. sort functions in C++ generally takes O(NlogN) time. However, if we add a custom comparator function where we apply some logic, how does this complexity change.

Suppose an example, where I am sorting an array of strings using the custom comparator functions,
in this function I have to iterate through the entire length of the string. Let's say the max length of the strings is k. So will the complexity be O(KNlogN) or it will be something else? Can someone please help me with this?

Comments (1)