Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Write a predicate lists to return the list elements of a given list (use atomic)
- EX: lists ([1, [2,3], [4], 5], X). ---> X=[[2,3],[4]]
- 2. Write a pedicate perm to list all permutations of a given number n
- EX: perm(3,X). ---> [[1,2,3],[2,1,3],[2,3,1],[1,3,2],[3,1,2],[3,2,1]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement