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!

Search results for query: *

  1. programmer720

    reverse and intersect problems

    I'm looking for these 2 algorithms... REVERSE: given a list L, find the reverse R of L (top-level elements only). For example, ?-reverse([ ], R). should answer R = [ ] ?-reverse([1, 2, [3, 4]], R). should answer R = [[3, 4], 2, 1]. INTERSECT: given sets X and Y (represented as lists)...
  2. programmer720

    Selection Sort Problem

    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...

Part and Inventory Search

Back
Top