Sorting Algorithms

  • Bubble Sort
    Exchange two adjacent elements if they are out of order. Repeat until array is sorted. This is a slow algorithm.
  • Quick Sort
    Partition array into two segments. The first segment all elements are less than or equal to the pivot value.
    The second segment all elements are greater or equal to the pivot value. Sort the two segments recursively. Quicksort is fastest on average, but sometimes unbalanced partitions can lead to very slow sorting.

     
  • Insertion Sort
    Scan successive elements for out of order item, then insert the item in the proper place. Sort small array fast, big
    array very slowly.
     
  • Shell Sort
    Sort every Nth element in an array using insertion sort. Repeat using smaller N values, until N = 1. On
    average, Shellsort is fourth place in speed. Shellsort may sort some distributions slowly.
  • Selection Sort
    Find the largest element in the array, and put it in the proper place. Repeat until array is sorted. This is also slow.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值