![]() |
|
#11
|
|||
|
|||
Ok I think I know what I was doing wrong.I think I got the bucket sort working. I think I know what I was doing wrong. I was trying to make the array and the sort seperate but really they kind of go together. Could someone just look over my code and please help me figure why it is not displaying the duplicates as duplicates. I added a while loop to try to catch them before they reached the sorted array but it is not working. I don't know why because I am not getting any errors. Here is the code.
CPP / C++ / C Code:
|
|||
|
#12
|
|||
|
|||
|
Quote:
I am having a heckofa time trying to follow what you are attempting. Maybe you can print out the progress through the generation loop and see if it's what you had in mind. You could try something like this: CPP / C++ / C Code:
There is no way that I can see how to "fix" it, since I can't guess what it is supposed to be doing. I can see that, sooner or later, you end up with 20 numbers between 1 and 99 in array "unsorted" and 20 or fewer numbers in array "sorted", but I can't for the life of me figure out why you are doing this. I can see nothing here that tests to see if the new number is a duplicate of a previous number. Regards, Dave |
Recent GIDBlog
Accepted for Ph.D. program by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Merge sort on a linked list | Temujin_12 | C++ Forum | 1 | 06-Mar-2008 21:33 |
| bucket sort problem | ap6118 | C++ Forum | 3 | 15-Apr-2005 19:02 |
| [GIM] gim.h | dsmith | C Programming Language | 0 | 18-Jan-2005 09:48 |
| insert sort | saphir55 | C Programming Language | 4 | 06-Dec-2004 15:00 |
| help with Sort arrays/Size | justachessgame | C Programming Language | 1 | 13-Nov-2004 00:46 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The