01.06.2013 Views

Appel initial : Le premier appel de la fonction.

Appel initial : Le premier appel de la fonction.

Appel initial : Le premier appel de la fonction.

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

. Complétez une liste<br />

Récursivité c<strong>la</strong>ssique :<br />

let rec complete liste =<br />

let x = read_int() in<br />

if x int list = <br />

complete [5;8];;<br />

1<br />

2<br />

-1<br />

- : int list = [1; 2; 5; 8]<br />

Récursivité terminale :<br />

let complete liste =<br />

let rec aux accumu<strong>la</strong>teur liste =<br />

let x = read_int() in<br />

if x int list = <br />

complete [5;8];;<br />

1<br />

2<br />

-1<br />

- : int list = [2; 1; 5; 8]<br />

let complete liste =<br />

let rec aux accumu<strong>la</strong>teur liste =<br />

let x = read_int() in<br />

if x int list = <br />

complete [5;8];;<br />

1<br />

2<br />

-1<br />

- : int list = [1; 2; 5; 8]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!