Write a Prolog function remove Second which removes the seco

Write a Prolog function remove Second which removes the second element of a given list. For example: removeSecond ([A [A B] C], L) Returns L = [A C] and removeSecond ((A B [C D]], L) Returns L = [A [C D]] Write a Prolog function countA11X which counts the number of occurrences of an element in a list, no matter how deeply nested they are. For example. COuntA11X (A, [A B A [A 1 A [A A]]], N) Returns N = 6

Solution

define directive is used to define values or macros which are used by the preprocessor to govern the program source code before it\'s miles compiled. due to the fact preprocessor definitions are substituted before the compiler acts at the source code, any errors which can be brought by using #outline are difficult to hint.

by using conference, values described using #outline are named in uppercase. even though doing so isn\'t always a demand, it\'s far considered very awful exercise to do otherwise. This permits the values to be without difficulty diagnosed whilst reading the source code.

 Write a Prolog function remove Second which removes the second element of a given list. For example: removeSecond ([A [A B] C], L) Returns L = [A C] and remove

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site