I am wrote a program that generates 20 random numbers from 1-99 and put them into an array. I am trying to sort them with a bucket sort, but I can't figure out how to do it. I have searched google and yahoo for information but everything I find just give me snip its of code. Which doesn't help me figure out how to put it into my code. I have a book but it covers every type of sort but a bucket sort. Please help me.

Recommended Answers

All 5 Replies

Clickie. Bucket sort isn't as common of a term as you might think. It's actually more common to hear about variants such as radix sort.

I am wrote a program that generates 20 random numbers from 1-99 and put them into an array. I am trying to sort them with a bucket sort, but I can't figure out how to do it. I have searched google and yahoo for information but everything I find just give me snip its of code. Which doesn't help me figure out how to put it into my code. I have a book but it covers every type of sort but a bucket sort. Please help me.

I assume by now that you've found the answer, but if not check out:
http://www.codecogs.com/d-ox/array/sort/bucketsort.php

Please dont resurrect dead threads like a shaman.
Thread closed.

I need a program on Bucket Sort in c++. Searched all over the internet but all the programs provided are not working!!

Searched all over the internet but all the programs provided are not working!!

You could try to understand the algorithm and write your own, or strive to make the programs you found work...but that might be too much to expect from today's programming students who seem to want everything given to them.

Here's a better idea: start a new thread and ask for help in understanding the algorithm or fixing one of the supposedly broken programs you've found. But before you do that, read this article.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.