![]() |
| ||
| Quicksort problems Hi there everyone. I wonder if you could help me with my code. It just seems to go into an infinite loop. I would greatly appreciate some help with this. Thanks #include<iostream> Thanks once again |
| ||
| Re: Quicksort problems IF your intent is to sort a range of integers beginning at first and continuing to last, there are simpler ways to do it. You don't need two loops or so many extra varaibles. If you need to sort from both ends, shouldn't pivot be in the middle of the arrary rather than equal to array[first]? |
| ||
| Re: Quicksort problems #include<iostream> first, you should learn how to format your code correctly... second, saying this int a=0;is the same thing as saying int a=b-c;when you have b and c declared... third, what are you doing there? it seems like you are ordering numbers from least to greatest... but... JRM is right... you could do this with less variables... |
| All times are GMT -4. The time now is 9:16 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC