Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

liliy Group Title

which sorting method works fastest: 1.randomized array 2.nearly sorted array 3.reversed 4.array with duplicates *(assume that it is a large array with like 100,000 numbers)

  • 2 years ago
  • 2 years ago

  • This Question is Closed
  1. xaadi1993 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    nearly sorted

    • 2 years ago
  2. liliy Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    no, i think u misunderstood my question. basically i need to do it 4 diff ways and seee hich one is the best for diff methods these are my answers: ranomized:best is: mergesort reverse:bubblesort nearly sorted:bubblesort duplicates: selectionsort

    • 2 years ago
  3. xaadi1993 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    what u wanna know?

    • 2 years ago
  4. liliy Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    if my choices are correct/make sense/ like for a randomized array, it is sorted fastest using mergesort reverse is fastest with bubble...

    • 2 years ago
  5. xaadi1993 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    isnt reverse better with insertion sort?

    • 2 years ago
  6. liliy Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    oh, ya, but thats not one of my choices.. i have buble sort,mege, selection

    • 2 years ago
  7. xaadi1993 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    use merge here because bubble sort will take more steps

    • 2 years ago
  8. bdean20 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Of your choices, merge sort is by far the best. Quicksort is probably the other major alternative to have a look at. A cool one for arrays with only a small range of possible numbers is counting sort: http://en.wikipedia.org/wiki/Counting_sort

    • 2 years ago
  9. jaskiratsingh Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    Merge sort and Randomised Quicksort have running times of O(n lg n). Bubble sort and Selection sort is O(n^2) Now O(n lg n) is faster than O( n^2), for a large enough n. Hence, Merge sort and Quicksort beats Bubble and Selection sort. Also, Counting sort has linear running time O(n). So, that's even better that O(n lg n), but it's complex and a little hard to understand.

    • 2 years ago
  10. infinity_ Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    http://www.sorting-algorithms.com/

    • 2 years ago
  11. infinity_ Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    the url above tells me randomized -> merge sort revese -> shell sort nearly sorted->insertion sort duplicates -> quick sort, but insertion works quite good as well.

    • 2 years ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.