Coder Social home page Coder Social logo

algorithmcode's Introduction

算法题

常见的时间复杂度

  • 常数阶:O(1)
  • 线性阶:O(n)
  • 对数阶:O(logn)
  • 平方阶:O(n²)
  • 立方阶:O(n³)
  • 指数阶:O(2ⁿ)

排序

几种排序对比

类型 最小时间复杂度 最大时间复杂度 空间复杂度 稳定性
冒泡排序 O(N²) O(N²) O(1) 稳定
选择排序 O(N²) O(N²) O(1) 不稳定
插入排序 O(N) O(N²) O(1) 稳定
希尔排序 <O(N²) O(N²) O(1) 不稳定
归并排序 O(NlogN) O(NlogN) O(N) 稳定
快速排序 O(NlogN) O(N²) O(NlogN) 不稳定
堆排序 O(NlogN) O(NlogN) O(1) 不稳定

冒泡排序

选择排序(Selection Sort)

归并排序(Merge Sort)

插入排序(Insertion Sort)

直接插入排序是将一个记录插入到已经排序好的有序表中,从而得到一个新的、记录数增1的有序表。

快速排序(Quick Sort)

堆排序(Heap Sort)

计数排序(Count Sort)

桶排序(Bucket Sort)

数据结构

数组

堆栈

队列

链表

二叉树

algorithmcode's People

Contributors

gxd523 avatar

Watchers

James Cloos avatar  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.