Skip to content

serrodcal-MULCIA/PLExercises1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

PLExercises1

First block of exercises of Prolog for Logic Programming

Exercise 1

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.

Exercise 2

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.

About

Exercises of Prolog for Logic Programming

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages