Thank you for your reply,
Can you please provide an example for the following list... or guide me where to look?
(97 86 45 23 87 43 26 72 35 64 63 54 89 43 89 56)
(verify your program on the following inputs)
Main Topics
Browse All TopicsHow can I sort a list in LISP without using inbuilt sort function. I would like to write my own Sort function which can take a list of numbers or list or words and will sort them.
can someone please help
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
OK. Well break it down into the sub-sections you need to implemented
1) Code to choose an element from a list. For simplicity you can just choose the 1st element, that is your pivot point
2) Use the pivot value to create list of elements < pivot
3) Use the pivot value to create list of elements > pivot
4) Append / recursively call quicksort with left list, pivot and right list
Get a start, and I will help you. Like I said, I cannot start the code for you.
Take a look at remove-if and remove-if-not functions, those will help you construct the left and right lists. Also look at lambda, it can be used for the predicate for remove-if/remove-if-not
Not trying to be hard on you. I have written a quicksort for this solution, so I am referring to it as we go. Unfortunately I cannot post it in completion, since the goal is to help you learn. So feel free to ask as many questions as you need, and I will help you if you get stuck. Like I said, lets work it in phases if that helps.
Well, this is one reason I don't care for Lisp. Easy things that Perl/Python do automatically require odd conversions, etc. You can write conditional code that checks for the types of arguments, then calls write-to-string only on non-strings (call it on a string and it will add more quotes around an existing string).
I found that you can use: (format nil "~a" x)
For any type of x and it will produce a string. So you could write:
Business Accounts
Answer for Membership
by: mrjoltcolaPosted on 2009-05-31 at 13:52:03ID: 24513885
You can recursively sort it comparing car and cdr and reversing the order if car > cdr