![]() |
|
#1
|
|||
|
|||
please help with reverseHello everyone... i just wrote a simple quicksort program using C++ ..
it works fine sorting it and all.. but what i am trying to do now is to reverse the sort results... so for instance if you type in: 5 7 3 9 6 it should give: 9 7 6 5 3 instead of 3 5 6 7 9 my code is: CPP / C++ / C Code:
i am pretty sure the changes are minor... but not sure what needs to be changed... please anyone help me.. thanks!!!! Last edited by LuciWiz : 31-Aug-2007 at 23:47.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|
#2
|
|||
|
|||
Re: please help with reverseSince it appears that you don't want to use the std::algorithm reverse operation, maybe this will work for you?
CPP / C++ / C Code:
Output: Code:
Also, why do: CPP / C++ / C Code:
:davis: |
|
#3
|
|||
|
|||
Re: please help with reversehey,... ummmmm is there a way not to use reverse function.... maybe just change the "<" to">" somewhere.. ?
i mean i understand the use of reverse function but not sure how to apply to the code that i provided... can anyone modify what i have? |
|
#4
|
|||
|
|||
Re: please help with reversei don't know whether i understand you or not.
just change two places; CPP / C++ / C Code:
Last edited by LuciWiz : 02-Sep-2007 at 05:58.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
Recent GIDBlog
2nd Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Convert English phrases to morse code and it‘s reverse process | pigfromsahara | C Programming Language | 25 | 13-Jun-2008 20:42 |
| Reverse a number or digits | tootoo | CPP / C++ Forum | 6 | 29-Jul-2007 20:34 |
| reverse a string using recursion | varun51 | C Programming Language | 1 | 13-Oct-2006 18:31 |
| Reverse DNS entries | admin | Web Hosting Forum | 1 | 21-Apr-2006 10:39 |
| DNS report for my site... | russ | Web Hosting Forum | 4 | 15-Oct-2004 23:13 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The