From fb14196b8e69ae018be104ed530833d61eddf427 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 11 Oct 2023 12:26:17 +0200 Subject: [PATCH] vault backup: 2023-10-11 12:26:17 --- Algo/CM/Lists.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Algo/CM/Lists.md b/Algo/CM/Lists.md index 88e6e1f..6b9b614 100644 --- a/Algo/CM/Lists.md +++ b/Algo/CM/Lists.md @@ -42,3 +42,13 @@ WITH `first`return the first element of the list (is equivalent to contents) `tail`remove the first element of the list (eg. fl <- tail (li)) `next`return the element after a box (eg. pspt <= next(head(li)))) + +## Array implementation +Let's take a list l = E ; D ; C ; B ; A. An array implementation of the list l will be: + +|1|2|3|4|5| +|:----:|:----:|:----:|:----:|:----:| +|A|B|C|D|E| +|5| + +The first line of the table is the $n^{th}$ place of the element, the second line is all the element of the list, and the third line is the place of the first element of the list (here E is at the $5^{th}$ position).