GeeksforGeeks » Java specific Questions

Merge Vs Quick Sort

(3 posts)
  • Started 7 months ago by gksgeek
  • Latest reply from Richipal
  1. gksgeek
    Member
    Posted 7 months ago #

    Java standard prefers merge sort , but c++ standard prefers quick sort , both have average time complexity of O(nlog n) then why we do so ?

  2. karthik
    Member
    Posted 4 months ago #

    Actually,Merge sort has O(nlogn) in worst case but quick sort has O(n2) in worst case so i think java uses the optimized sort technique compared to C++

  3. Richipal
    guest
    Posted 4 months ago #


Reply

You must log in to post.

RSS feed for this topic