Q 10. Write a prolog procedure every-other/2 that receives a source list as its first argu- ment and produces a list in

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Q 10. Write a prolog procedure every-other/2 that receives a source list as its first argu- ment and produces a list in

Post by answerhappygod »

Q 10 Write A Prolog Procedure Every Other 2 That Receives A Source List As Its First Argu Ment And Produces A List In 1
Q 10 Write A Prolog Procedure Every Other 2 That Receives A Source List As Its First Argu Ment And Produces A List In 1 (46.52 KiB) Viewed 47 times
prolog please
Q 10. Write a prolog procedure every-other/2 that receives a source list as its first argu- ment and produces a list in the second argument whose elements are the elements of odd indexes in the source list. Examples are given in the following: ?- every-other ([], L) L = []. ?- every-other ([1], L) L = [1]. ?- every-other ([1, 2], L) L = [1]. ?- every-other ([1, 2, 3], L) L = [1, 3]. ?- every-other ([1, 2, 3, 4], L) L = [1, 3]. Make sure your procedure is efficiently terminated.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply