Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Programming chalenge: Bogosort

Programming chalenge: Bogosort

Scheduled Pinned Locked Moved The Lounge
c++algorithmscsharplounge
24 Posts 15 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N NetDave

    I'd love to see this sort algorithm visually[^]

    QRZ? de WAØTTN

    D Offline
    D Offline
    Dan Neely
    wrote on last edited by
    #21

    Nice. :cool:

    3x12=36 2x12=24 1x12=12 0x12=18

    1 Reply Last reply
    0
    • N NetDave

      I'd love to see this sort algorithm visually[^]

      QRZ? de WAØTTN

      P Offline
      P Offline
      peterchen
      wrote on last edited by
      #22

      here you go![^]

      FILETIME to time_t
      | FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy

      1 Reply Last reply
      0
      • N Nemanja Trifunovic

        Just learned about the best sorting algorithm ever: Bogosort[^] Here is my implementation in C++ (note use of C++0x is_sorted algorithm):

        template <class RandomAccessIterator, class Compare>
        void bogo_sort (RandomAccessIterator first, RandomAccessIterator last, Compare comp)
        {
        while (!is_sorted(first, last, comp))
        random_shuffle(first, last);
        }

        utf8-cpp

        B Offline
        B Offline
        Bminas
        wrote on last edited by
        #23

        I believe that this falls under the group of algorithms known as pessimal. For the academic treatment, please see: http://www.bowdoin.edu/~ltoma/teaching/cs231/fall03/broder86pessimal.pdf[^]

        1 Reply Last reply
        0
        • H Henry Minute

          Is this a spoon I see before me?

          Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus! When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is.

          D Offline
          D Offline
          djdanlib 0
          wrote on last edited by
          #24

          Perhaps it is a spoony bard?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups