咖啡's profileSeparate LivesPhotosBlogLists Tools Help
    3/27/2008

    几种排序算法分析

    几个程序试验了一下几种快速排序算法,生成了分析报告图

     SORT_PLOT-ALMOST-SORTEDSORT_PLOT-RANDOMSORT_PLOT-REVERSESORT_PLOT-SORTEDchart

    Testing performance for sets of 10000, 10 trials...
    SELECTION SORTED 10000 224.8
    SELECTION ALMOST-SORTED 10000 224.7
    SELECTION REVERSE 10000 218.3
    SELECTION RANDOM 10000 215.3
    INSERTION SORTED 10000 0.0
    INSERTION ALMOST-SORTED 10000 17.1
    INSERTION REVERSE 10000 171.7
    INSERTION RANDOM 10000 88.7
    BUBBLE SORTED 10000 0.0
    BUBBLE ALMOST-SORTED 10000 422.8
    BUBBLE REVERSE 10000 474.2
    BUBBLE RANDOM 10000 691.3
    MERGE SORTED 10000 4.6
    MERGE ALMOST-SORTED 10000 4.7
    MERGE REVERSE 10000 3.0
    MERGE RANDOM 10000 1.5
    SHELLSORT-A SORTED 10000 3.1
    SHELLSORT-A ALMOST-SORTED 10000 4.8
    SHELLSORT-A REVERSE 10000 1.5
    SHELLSORT-A RANDOM 10000 3.1
    SHELLSORT-B SORTED 10000 0.0
    SHELLSORT-B ALMOST-SORTED 10000 1.5
    SHELLSORT-B REVERSE 10000 0.0
    SHELLSORT-B RANDOM 10000 3.1
    QUICKSORT-A SORTED 10000 0.0
    QUICKSORT-A ALMOST-SORTED 10000 3.2
    QUICKSORT-A REVERSE 10000 0.0
    QUICKSORT-A RANDOM 10000 1.5
    QUICKSORT-B SORTED 10000 0.0
    QUICKSORT-B ALMOST-SORTED 10000 0.0
    QUICKSORT-B REVERSE 10000 0.0
    QUICKSORT-B RANDOM 10000 1.6
    QUICKSORT-C SORTED 10000 0.0
    QUICKSORT-C ALMOST-SORTED 10000 0.0
    QUICKSORT-C REVERSE 10000 1.6
    QUICKSORT-C RANDOM 10000 0.0
    QUICKSORT-D SORTED 10000 0.0
    QUICKSORT-D ALMOST-SORTED 10000 1.5
    QUICKSORT-D REVERSE 10000 34.3
    QUICKSORT-D RANDOM 10000 3.1

    Comments (4)

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    wrote:
    久不来看,不过你更新的也实在够慢.
    May 28
    jin zhaowrote:
    看不懂,苍天啊,什么东东哦
    May 3
    Lin Bobrwrote:
    您好阿
    我是新朋友請多多指教喔
    很高興能認識您喔
    祝您天天開心 事事順心
    Apr. 9
    NIAN CI CHENwrote:
    嚇?睇唔明你係度寫咩O野!
    Apr. 6

    Trackbacks

    The trackback URL for this entry is:
    http://skycn.spaces.live.com/blog/cns!7A24916A92570361!833.trak
    Weblogs that reference this entry
    • None