VILL- DEBANDI, AMTA, HOWRAH PIN-711410 Phone-9836357266
Find the K'th element of a list in prolog
element_at(X,[X|_],1).
element_at(X,[_|L],K) :- K > 1, K1 is K - 1, element_at(X,L,K1).
No comments:
Post a Comment