Which of the following definitions is/are syntactically correct: (i) filter(p, [h|t]) -> case p(h) of true -> [h\filter(p, t)] false -> filter(p, t) end filter(p, []) -> [] (ii) filter(P, []) -> [];...

Please tell answer quicklyWhich of the following definitions is/are syntactically correct:<br>(i)<br>filter(p, [h|t]) -><br>case p(h) of<br>true -> [h\filter(p, t)]<br>false -> filter(p, t)<br>end<br>filter(p, []) -> []<br>(ii)<br>filter(P, []) -> [];<br>filter(P, [H|T]) -><br>case P(H) of<br>true -> [H[filter(P, T)];<br>false -> filter(P, T)<br>end.<br>(ii)<br>filter(P, [H|T]) -><br>case P(H) of<br>true -> [H|filter(P, T)];<br>false -> filter(P, T)<br>end;<br>filter(P, []) -> 1.<br>O (1) only<br>O (i) only<br>(iii) only<br>O (i) and (i)<br>O None of the above.<br>

Extracted text: Which of the following definitions is/are syntactically correct: (i) filter(p, [h|t]) -> case p(h) of true -> [h\filter(p, t)] false -> filter(p, t) end filter(p, []) -> [] (ii) filter(P, []) -> []; filter(P, [H|T]) -> case P(H) of true -> [H[filter(P, T)]; false -> filter(P, T) end. (ii) filter(P, [H|T]) -> case P(H) of true -> [H|filter(P, T)]; false -> filter(P, T) end; filter(P, []) -> 1. O (1) only O (i) only (iii) only O (i) and (i) O None of the above.

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here