₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,061 members, 8,448,481 topics. Date: Monday, 20 July 2026 at 11:58 AM

Toggle theme

Implement The Quick Sort Algorithm In Your Language. - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingImplement The Quick Sort Algorithm In Your Language. (1303 Views)

1 Reply (Go Down)

Implement The Quick Sort Algorithm In Your Language. by Nobody: 11:04pm On Oct 17, 2017
I'm trying to run benchmark tests using AB.

I want to test the efficiency of languages against the quick sort algorithm.
Id appreciate anyone willing to help me test as I'm quite busy...


In Go I have :

package qsort

import "math/rand"

func QuickSort(slice []int) []int {
length := len(slice)

if length <= 1 {
sliceCopy := make([]int, length)
copy(sliceCopy, slice)
return sliceCopy
}

m := slice[rand.Intn(length)]

less := make([]int, 0, length)
middle := make([]int, 0, length)
more := make([]int, 0, length)

for _, item := range slice {
switch {
case item < m:
less = append(less, item)
case item == m:
middle = append(middle, item)
case item > m:
more = append(more, item)
}
}

less, more = QuickSort(less), QuickSort(more)

less = append(less, middle...)
less = append(less, more...)

return less
}
Re: Implement The Quick Sort Algorithm In Your Language. by Kod3007(m): 11:17pm On Oct 17, 2017
grin
i would have written it in php but php is your primary language undecided
Re: Implement The Quick Sort Algorithm In Your Language. by melodyogonna(m): 11:51pm On Oct 17, 2017
DanielTheGeek:
I'm trying to run benchmark tests using AB.

I want to test the efficiency of languages against the quick sort algorithm.
Id appreciate anyone willing to help me test as I'm quite busy...


In Go I have :
try to alwalys embed ur code between "[code][/code]".
Re: Implement The Quick Sort Algorithm In Your Language. by Nobody: 8:07pm On Oct 18, 2017
melodyogonna:
try to alwalys embed ur code between "[code][/code]".
Well, I know. It just seems to break things....

Where's your code solution?
Re: Implement The Quick Sort Algorithm In Your Language. by Nobody: 9:57pm On Oct 18, 2017
Boss ur code is cool.
Re: Implement The Quick Sort Algorithm In Your Language. by Nobody: 10:05pm On Oct 18, 2017
proxy20:
Boss ur code is cool.
Thanks, should I expect any implementation from you?
Re: Implement The Quick Sort Algorithm In Your Language. by Nobody: 10:10pm On Oct 18, 2017
DanielTheGeek:
Thanks, should I expect any implementation from you?
Just here to learn you guys write quicksort in Java, js, c#,python, ruby,haskell,c++ or more
Re: Implement The Quick Sort Algorithm In Your Language. by Nobody: 10:17pm On Oct 18, 2017
proxy20:
Just here to learn you guys write quicksort in Java, js, c#,python, ruby,haskell,c++ or more
Well the bosses seem to be asleep or have abandoned NL. Maybe I should follow because the reception of this thread is just discouraging...
Re: Implement The Quick Sort Algorithm In Your Language. by Kod3007(m): 1:03am On Oct 19, 2017
DanielTheGeek:
Well the bosses seem to be asleep or have abandoned NL. Maybe I should follow because the reception of this thread is just discouraging...
Reception of almost every post on NL nowadays is discouraging, Many views ....trickling comments cry
Re: Implement The Quick Sort Algorithm In Your Language. by QueryUnical: 8:59pm On Oct 19, 2017
DanielTheGeek:
I'm trying to run benchmark tests using AB.

I want to test the efficiency of languages against the quick sort algorithm.
Id appreciate anyone willing to help me test as I'm quite busy...


In Go I have :
C++
https://www.google.com/search?client=firefox-b&q=implementing+quicksort+in+C%2B%2B&oq=implementing+quicksort+in+C%2B%2B&gs_l=psy-ab.12..0i30k1.36302.44589.0.46624.15.14.0.0.0.0.896.1644.6-2.2.0....0...1.1.64.psy-ab..13.2.1642...0.0.fExOXEHt5Gg&gfe_rd=cr&dcr=0&ei=9QLpWYlhjNVe2Ym20AI

Java
https://www.google.com/search?q=quicksort+algorithm+Java&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&dcr=0&ei=XgPpWa6DF4zVXtmJttAC


C#
https://www.google.com/search?q=implementing+quicksort+in+C%23&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&dcr=0&ei=aQPpWab5HIzVXtmJttAC


Python
https://www.google.com/search?q=implementing+quicksort+in+python&ie=utf-8&oe=utf-8&client=firefox-b&gfe_rd=cr&dcr=0&ei=dwPpWeTQGIzVXtmJttAC
1 Reply

Thread For Nairaland Algorithm QuestionsNigerian Developers How Did You Master Algorithm And Problem SolvingSimple Algorithm Exercise234

Startup That Teaches Devs For Free In PhWhich Standard Computer School Do You Recommend For Learning Programming?DBMS About Database