Merge sort best & average case O(n)?
https://github.com/TheAlgorithms/Python/blob/master/README.md#merge Shouldn't it be O(n log n).
The Java repo is correct though: https://github.com/TheAlgorithms/Java#merge
it's O(n log n ) only.
#342 I changed the readme and created a pull request
It is O(n*log(n)) for best, average and worst case. Where, n:size of the array under consideration.
Yes! It should be O(n*log(n)) for every case i.e. best case, average case, worst case.
Are you pointing out that there should be a "" between n and log(n)? like O(n log(n)) vs O(nlog(n))?
In readme file Merge, Quick and Shell is also using one space as multiplication instead of "*". Thats why I also used it that way in the PR.
@hasangokdag No. In the master, best & average are O(n) which are simply incorrect and misleading.
Hi @sfdye , @hasangokdag has corrected precisely what you are saying in his commit. Look at his commit: https://github.com/TheAlgorithms/Python/pull/342/commits/ce3e6787f4df7fa198881b1dfa80c58a5c7afbb5 But his PR is still open, please be patient and let the repo owners merge his PR.
@piyush-kgp Yeah I am aware of the PR. It should get high priority as this simple typo could fail someone's interview.
Yes. you are right. Just noticed that this thread is 9 days old. Apologies.
Thanks @hasangokdag
Finally this is merged. Cheers 👍