PDA

View Full Version : Quicksort Code


ObiwanJebroni
07-17-2003, 08:37 PM
Does anyone happen to have some quicksort code that I can use? I'm too lazy to think on it and write my own:o .

Jason
07-17-2003, 08:43 PM
sounds like homework for one and you didn't specify the language...


Jason

Spookster
07-17-2003, 08:53 PM
Originally posted by ObiwanJebroni
Does anyone happen to have some quicksort code that I can use? I'm too lazy to think on it and write my own:o .

This sounds exactly like a homework assignment. Teachers often give out this type of assignment is to teach you how sorting algorithms work. You learn nothing by having someone else do it for you.

We are not going to do your homework for you so you need to do it yourself. If you have problems while writing it then you can ask specific questions and we can guide you in the correct general direction.

ObiwanJebroni
07-17-2003, 09:02 PM
Well, it WOULD be a homework assignment IF it wasn't summer vacation. I know how the algorithm works, just translating it to C++ code is something that i'm not looking forward to doing. I'm currently using a bubble sort to sort groups of 5k+ sensors at work. Needless to say, it takes quite a bit of time to do the sort. Plus other calculations and you have a very long wait.

ObiwanJebroni
07-17-2003, 09:03 PM
Actually, nevermind, my boss coworker has a quicksort saved. Thanks anyway.

Spookster
07-17-2003, 10:01 PM
Originally posted by ObiwanJebroni
Well, it WOULD be a homework assignment IF it wasn't summer vacation. I know how the algorithm works, just translating it to C++ code is something that i'm not looking forward to doing. I'm currently using a bubble sort to sort groups of 5k+ sensors at work. Needless to say, it takes quite a bit of time to do the sort. Plus other calculations and you have a very long wait.

College and Universities typically have summer semesters. :)

Didn't mean to sound harsh but we get a lot of people in here trying to get people to do their homework for them. One assigment that is almost always assigned in college computer science programming courses is to write one of the many kinds of sorting algorithms. I had to do the merge-sort algorithm in java which was not very fun.

Jason
07-17-2003, 10:16 PM
I had to do all of them in more than one languade, and yes, there is always summer school....everywhere...


Jason

mordred
07-18-2003, 01:56 AM
Originally posted by Spookster
One assigment that is almost always assigned in college computer science programming courses is to write one of the many kinds of sorting algorithms. I had to do the merge-sort algorithm in java which was not very fun.

I hear you... I also had to do exactly the same this semester, and I think I can still feel the pain my brain endured while doing it...

Totally OT: What is this summer school thing? Here in Germany, I've never heard of this kind of thing. No one's going to school/college during the summer, the semesters are already long enough and do not leave that much time for work during the summer to cover your expenses.

ObiwanJebroni
07-18-2003, 09:46 PM
Oh no problem, I can imagine asking for homework. But I'm still in High School, so they haven't started giving us computer science summer work yet (thank God). Anyway, thanks for the help. I did end up writing it myself; not that hard, but thinking recursively always turns me off. Thanks anyway!

Spookster
07-18-2003, 09:50 PM
Originally posted by ObiwanJebroni
Oh no problem, I can imagine asking for homework. But I'm still in High School, so they haven't started giving us computer science summer work yet (thank God). Anyway, thanks for the help. I did end up writing it myself; not that hard, but thinking recursively always turns me off. Thanks anyway!

Well it's probably not a coincidence that the word recursive is just 2 letters away from being repulsive