[VIEWED 8842
TIMES]
|
SAVE! for ease of future access.
|
|
|
b27b
Please log in to subscribe to b27b's postings.
Posted on 10-14-10 12:48
PM
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
3,1,4,1,5,9,2,6,5,3,5
|
|
|
|
Bhojpure01
Please log in to subscribe to Bhojpure01's postings.
Posted on 10-14-10 1:25
PM [Snapshot: 20]
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Are you talking about excel or other specific program?
|
|
|
b27b
Please log in to subscribe to b27b's postings.
Posted on 10-14-10 1:31
PM [Snapshot: 26]
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
not in excel bud. I actually need on quick sort diagram.
|
|
|
dynamite
Please log in to subscribe to dynamite's postings.
Posted on 10-14-10 3:26
PM [Snapshot: 74]
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Sorry double post.
Last edited: 14-Oct-10 03:26 PM
|
|
|
dynamite
Please log in to subscribe to dynamite's postings.
Posted on 10-14-10 3:26
PM [Snapshot: 74]
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
Grabbing the pseudocode from wikipedia:
function quicksort(array) var list less, greater if length(array) ≤ 1 return array select and remove a pivot value pivot from array for each x in array if x ≤ pivot then append x to less else append x to greater return concatenate(quicksort(less), pivot, quicksort(greater))
iteration 1 Choose any pivot, for instance, 3 looks good then (1,1,2,3) 3 (4,5,9,6,5,5)
iteration 2
Chosing 2 as pivot , and 5 as pivot (1,1) (2) (3) 3 (4,5,5) 5 (6,9)
Third iteration, chosing random pivot as usual (1) (1) 2 (3) 3 (4,5) 5 5 (6)(9)
Last iteration: 1 1 2 3 3 4 5 5 5 6 9
I hope I am right and I hope it helps. :)
|
|
|
techGuy
Please log in to subscribe to techGuy's postings.
Posted on 10-14-10 3:45
PM [Snapshot: 110]
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
From http://en.wikipedia.org/wiki/Quicksort You can replace ur numbers to following diagram
|
|
|
default061
Please log in to subscribe to default061's postings.
Posted on 10-15-10 3:00
AM [Snapshot: 244]
Reply
[Subscribe]
|
Login in to Rate this Post:
0
?
|
|
This should give you the concept. Yellow bg indicates May Not Require This Step/Possibly wrong. Red int indicates the selection of the partition point ( starting at right -- pivot). underlined is the position where it is sorted. { } =selection of block . When block has one element, it is sorted already. Bold int= upcoming pivot
|
|