Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
aa:lab:13 [2021/01/18 09:56] pdmatei created |
aa:lab:13 [2021/01/25 20:10] (current) stefan.stancu [ADT implementation] |
||
---|---|---|---|
Line 30: | Line 30: | ||
2.2. Define operators and their proper axioms for: | 2.2. Define operators and their proper axioms for: | ||
- | * the concatenation of two ''FIFO''s | + | * the concatenation of two ''FIFO''s |
- | * the operations ''top'' and ''dequeue'' used in a previous lecture (''top'' produces the //first-in// element of the ''FIFO'' while ''dequeue'' returns a ''FIFO'' without this very element) | + | * the operations ''top'' and ''dequeue'' used in a previous lecture (''top'' produces the //first-in// element of the ''FIFO'' while ''dequeue'' returns a ''FIFO'' without this very element) |
==== ADT implementation ==== | ==== ADT implementation ==== | ||
- | Implement the ''ADT'' ''Tree'' and ''FIFO'' in Python, together with its operations. **Use two stacks to implement the ''FIFO''**. | + | Implement the ''ADT'' ''Tree'' and ''FIFO'' in Python, together with thier operations. **Use two stacks to implement the ''FIFO''**. |
For the implementation, you may use classes, following the example shown in the lecture. To what extent can you use the axioms to provide //**correct**// implementations for each operation? | For the implementation, you may use classes, following the example shown in the lecture. To what extent can you use the axioms to provide //**correct**// implementations for each operation? | ||