Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- declare
- fun {Incorpore L1 L2}
- case L1
- of A|B then
- case L2 of H|T then
- if H == A then {Incorpore B T}
- else {Incorpore L1 T} end
- else false end
- else true end
- end
- fun {Apex LL}
- fun {Avant X L}
- fun {Apres B C}
- case C of H|T then
- if {Incorpore B H} then {Apres H T}
- else false end
- else true end
- end
- in
- case L of H|T then
- if {Incorpore H X} then
- if {Apres H T} then H|{Avant H T}
- else {Avant H T} end
- else nil end
- else nil end
- end
- in
- case LL of H|T then
- case {Avant H T}
- of A|nil then true
- else false end
- else false end
- end
- {Browse {Incorpore [2 5 4] [3 2 8 2 6 5 3 4]}}
- {Browse {Incorpore [1 2] [2 1]}}
- {Browse {Apex [[3 5 2 4] [3 2 4] [5 3 4 2 6 3]]}}
- {Browse {Apex [[3 5 2 4] [3 2 4] [5 3 4 2 6 4]]}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement