Re: Loops
"Buday, Gergely Istvan" <[email protected]>
| Newsgroups | gmane.comp.lang.sml.smlnj |
|---|---|
| Message-ID | <89AE2DBAB3A9E943A358F9780F266AC37E941E@budgw09a.ww300.siemens.net> |
> The reason I need to use a loop is to write a quicksort function. My > assignment is to write quicksort in two programming languages > of different > paradigms. In my case functional versus procedural [ SML vs. C ]. Dear Claude, I do think that quicksort is recursive in nature. Actually, it's quite tough to write it in iterative style, as even Hoare admitted it. I do understand that a comparison could be that you use the same algorithm in both cases (sml and c). But that would not be a "functional" program, even if it's implemented in a functional language. Paulson's book is quite OK, I don't know if your library has one. Another thing to do is to try a smaller problem about recursive functions. + read the Basis Library spec about vectors and arrays. And, last but not least, if you use a famous search engine, you can find quicksort implementations in sml. That would help you out how to start. Others in this list might criticise me to suggest this, as we are not here to solve other's homework, but I do think that your tutor should have been aware of this when posing this problem. Please don't submit them, I think you wouldn't do this. Should you have any questions, just send your trial code to the list, and I'll try to help you. Best Wishes - Gergely ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642