Question: ? - n q ueen ( 1 0 , x ) . x = [ 7 , 4 , 2 , 9 , 5 ,

?-nqueen (10,x).
x=[7,4,2,9,5,10,8,6,3|dots]
?-nqueen (8,x).
x=[4,2,7,3,6,8,5,1].
?-nqueen (4,x).
x=[3,1,4,2].
?- halt.
In this problem, I need to solve by Prolog. Please write the output and input as given.
 ?-nqueen (10,x). x=[7,4,2,9,5,10,8,6,3|dots] ?-nqueen (8,x). x=[4,2,7,3,6,8,5,1]. ?-nqueen (4,x). x=[3,1,4,2]. ?- halt.

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!