• Non ci sono risultati.

Write a program which given one list L of integers and an integer value N decides if X belongs to L

N/A
N/A
Protected

Academic year: 2021

Condividi "Write a program which given one list L of integers and an integer value N decides if X belongs to L"

Copied!
1
0
0

Testo completo

(1)

Write a predicate second(X,List) which checks if X is the second element

of List.

Write a Prolog program which computes the fibonacci numbers.

Write a (Prolog) program which takes in input two ordered lists of integers

and returns an ordered list of integers containing all elements in the

original lists.

Write a (Prolog) program that taken one list L of integers and one integer

value N, divides the elements of L in two lists L1 and L2 such that all elements less or equal than N are in L1 and in L2 all the others.

Write a program which given a list of integers L returns an ordered list

of integers containing the elements in L.

Write a program which given one list L of integers and an integer value N

decides if X belongs to L.

Write a program which given two lists L1 and L2 of integers decides if all elements in the first list are present in the second one.

=======More difficult

find a representation for binary trees.

Then write a program to look for a value N inside a binary search tree.

Riferimenti

Documenti correlati

Description: the space including the object is partitioned in cubic cells; each cell contains references to “primitives” (i.e.. Primitives are

For questions requiring calculations, full credit is given only if necessary steps of the calculations are

Solution proposed by Roberto Tauraso, Dipartimento di Matematica, Universit`a di Roma “Tor Vergata”, via della Ricerca Scientifica, 00133 Roma,

Solution proposed by Roberto Tauraso, Dipartimento di Matematica, Universit`a di Roma “Tor Vergata”, via della Ricerca Scientifica, 00133 Roma, Italy. If at least one of the functions

Now we modify the last row of M n by adding a proper linear combination of the other rows. This operation does not change the determinant of M n , but it will help us to

In the fourth chapter, the behavior of entanglement in open quantum systems is described: in particular, a two-qubit system is studied, analyzing both entanglement generation

Write a (Prolog) program which computes the vectorial product of two input lists of integers. having the

Write a Prolog program which returns the element of a list L1 which are not included in a second list L2.. Write a Prolog program which decides if two binary trees are equivalent