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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. The Lounge
  3. quick sort algorithm using middle element as pivot

quick sort algorithm using middle element as pivot

Scheduled Pinned Locked Moved The Lounge
algorithmsdata-structures
5 Posts 5 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.
  • S Offline
    S Offline
    Shuvradip Sarma
    wrote on last edited by
    #1

    here is the code- public static int partition(int array[],int start,int end) { int pivot_index=(start+end)/2; int pivot=array[pivot_index]; int i=start; int j=end; while(ipivot) { j--; } if(i

    Richard DeemingR OriginalGriffO R D 4 Replies Last reply
    0
    • S Shuvradip Sarma

      here is the code- public static int partition(int array[],int start,int end) { int pivot_index=(start+end)/2; int pivot=array[pivot_index]; int i=start; int j=end; while(ipivot) { j--; } if(i

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2
      1. Read the red text at the top of this page: No programming questions in the Lounge. 2) You have already posted this in QA: Cannot implement quick sort algorithm using pivot as middle element.how do I solve it?[^] 3) You still haven't fixed the problem with what you posted in QA - namely, the code you have pasted is corrupt and incomplete.

      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      • S Shuvradip Sarma

        here is the code- public static int partition(int array[],int start,int end) { int pivot_index=(start+end)/2; int pivot=array[pivot_index]; int i=start; int j=end; while(ipivot) { j--; } if(i

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #3

        Even if that was complete, and formatted, and top quality code ... why are you posting it here? We all wrote bubble sort, quicksort, double bubble, and such like when we were students. We pretty much don't write them now because we have optimised versions in libraries that we "just call" - there are exceptions, but they tend to be both rare and specialized and that code is neither - so why would we be interested in it. Unless it doesn't work, and you need help - in which case it's rather rude of you to just ignore the writing in read at the top of the page ...

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        1 Reply Last reply
        0
        • S Shuvradip Sarma

          here is the code- public static int partition(int array[],int start,int end) { int pivot_index=(start+end)/2; int pivot=array[pivot_index]; int i=start; int j=end; while(ipivot) { j--; } if(i

          R Offline
          R Offline
          Rage
          wrote on last edited by
          #4

          Please sort yourself and sort this code out.

          Do not escape reality : improve reality !

          1 Reply Last reply
          0
          • S Shuvradip Sarma

            here is the code- public static int partition(int array[],int start,int end) { int pivot_index=(start+end)/2; int pivot=array[pivot_index]; int i=start; int j=end; while(ipivot) { j--; } if(i

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            So are you going to listen to the comments on the other copy of this you posted? If not, you're not going to get anywhere on your assignment.

            Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
            Dave Kreskowiak

            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