Code Monkey home page Code Monkey logo

c-python-datastruct-and-algorithm's Introduction

冒泡排序算法要点:
1.外层遍历坐标为i从1到length-1,因为最后一个元素不需排序。
2.内层遍历从后部向前遍历,即j从length-1到i遍历,有助于将较小值从后部向前部移动。
3.每次元素比较为j和j+1比较,有助于访问越界(举一反三,若从前向后遍历,则j从2到length,比较为j和j-1).

选择排序算法要点:
1.外层遍历坐标为i从1到length-1,因为最后一个元素不需排序。
2.使用中间变量保存每次遍历后的最小值。

c-python-datastruct-and-algorithm's People

Contributors

wanlisun415 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.