GithubHelp home page GithubHelp logo

cl-algo-pseudosort's Introduction

#Pseudocode a Sorting Algorithm

Algorithms are fundamental to coding and sorting is fundamental to algorithms. In this exercise, we're going to implement a simple sorting algorithm using pseudocode. With pseudocode, there is no such thing as invalid syntax. But remember! Every line of your "code" should be able to translate into a single, direct programming statement.

Input: An unsorted array of n numbers

Output: A sorted (least to greatest) array n of numbers

Description:

  1. Start at the end of the list and get the last element: A[n]

  2. Compare that element to the one before it. A[n-1]

  3. If A[n] < A[n-1] , then swap the two elements

  4. Repeat this step until the first element, A[0] is the smallest

  5. Start back at the end, A[n] and repeat until the entire array is sorted

Hint: If you're having trouble visualizing how this algorithm works, just imagine the elements bubbling up from the bottom until they're all in order.

cl-algo-pseudosort's People

Contributors

rkirkendall avatar

Watchers

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