Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selection Sort Problem

Status
Not open for further replies.

programmer720

Programmer
Nov 21, 2002
2
US
I'm trying to come up with a selection sort algorithm for prolog. That is, lists X and Sorted satisfy the relation selection(X, Sorted) if Sorted is the sorted list containing all the elements of X.
For example, selection([3, 2, 2, 1, 4], Sorted) should return Sorted = [1, 2, 2, 3, 4].
Can someone please help? Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top