Complexity of sorting a list of strings

Правка en1, от The_mysterio, 2020-09-14 21:10:49

Hello Everyone, This is a just a thought that came to my mind. Normally we sort numbers with the time complexity of n log n where n is the number of numbers present in the array.Same for a list of characters. However, for a list of given strings,let us say all the strings are of equal length and that length is m. For comparing two strings we need at most iterations.So in that case , isnt the complexity (n^2)*m ???Because the recurrence relation will be T(n)=2*T(n/2)+ n*m---> where merging takes m units of time for each comparison of two strings... If anyone can clarify this doubt, It will be of great help.. Thanks in advance

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский The_mysterio 2020-09-14 21:10:49 688 Initial revision (published)