Giter Club home page Giter Club logo

Comments (2)

Holmesen avatar Holmesen commented on July 25, 2024

http://www.conardli.top/docs/algorithm/%E6%8E%92%E5%BA%8F/%E5%BF%AB%E9%80%9F%E6%8E%92%E5%BA%8F.html#%E5%86%99%E6%B3%952
这是地址

from awesome-coding-js.

ConardLi avatar ConardLi commented on July 25, 2024

快速排序里面的第二种写法代码里面有一处有错误。
第二行这里的
if (end - start < 2) { return; }
if里面应该是“end - start < 1”,不然的话当刚好有两个元素的话就无法去判断排序了。
比如这个数组“[23, 11, 5, 65, 7, 33, 2, 26]”,如果按照你的写法的话会输出“[ 2, 7, 5, 11, 23, 26, 33, 65 ]”,如果改成我那样的话就会正确输出“[ 2, 5, 7, 11, 23, 26, 33, 65 ]”

已修复,感谢提出。

from awesome-coding-js.

Related Issues (20)

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.