Question: In Prolog, define a predicate mergesort(In,Out) that makes a sorted version of a list In of numbers and unifies that result with Out. Your predicate

In Prolog, define a predicate mergesort(In,Out) that makes a sorted version of a list In of numbers and unifies that result with Out. Your predicate should use a merge-sort algorithm. SWI-Prolog has a predefined predicated called sort, and another called msort, that implement variations of merge sort. Don't use those, but choose another name for yours.

DON'T USE PREDEFINED PREDICATES SORT OR MSORT

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!