Created
December 14, 2012 16:13
-
-
Save trietptm/4286587 to your computer and use it in GitHub Desktop.
Tìm phần tử bé nhất của 1 list bằng Prolog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
findmin([X], X). | |
findmin([H|T], X) :- findmin(T, X), H >= X, !. | |
findmin([H|T], H) :- findmin(T, X), H < X, !. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment