GithubHelp home page GithubHelp logo

sort's Introduction

常用的排序

基础的排序算法,平均时间复杂度为O(n^2),包括选择排序,插入排序,冒泡排序等。
一般用的排序算法,平均时间复杂度为O(nlogn),包括归并排序,堆排序,快速排序,希尔排序等。
以及一些特殊情况下能用的排序算法,计数排序,桶排序,基数排序等。

稳定性

排序的稳定性指的是值相同的元素排序后是否相对位置发生变化,a,c,b,如果a=b,排序结束b在a前面,那么就是不稳定的。
比如我们对一批对象的某个成员进行排序,有时候不想改变该成员值相等的相对顺序。

排序方式

排序的排序方式指的是待排序的数据是否需要全部放置在内存中,当要排的数据非常大的时候,我们只能选择外部排序,整个排序过程能够在内外存之间多次交换数据进行。

各排序对比

下表囊括了常见的排序算法的各个性质的对比。 链接已失效

sort's People

Contributors

canrui-wu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.