First block of exercises of Prolog for Logic Programming
Consists of building a small Prolog file that counts ocurrences of a number sorted array (list in Prolog) with duplicates from a number provided.
*Inputs:
[2, 5, 5, 5, 6, 6, 8, 9, 9, 9]
target = 5
*Output:
Element 5 occurs 3 times.
Consists of building a small Prolog file that search a given number in a nearly sorted array (list in Prolog) in O(logn) time.
*Inputs:
[2, 1, 3, 5, 4, 7, 6, 8, 9]
target = 5
*Output:
Element 5 founds at index 3.