Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
aa:lab:9 [2025/12/08 22:34] dmihai |
aa:lab:9 [2025/12/12 14:00] (current) cezar.zlatea [Exerciții] |
||
|---|---|---|---|
| Line 22: | Line 22: | ||
| 1. Scrieți axiomele pentru următorii operatori: | 1. Scrieți axiomele pentru următorii operatori: | ||
| - | * $ \mathrm{height} : \mathrm{BTree} \to \mathrm{BTree}$ | + | * $ \mathrm{height} : \mathrm{BTree} \to \mathrm{Int}$ |
| * $ \mathrm{depth} : \mathrm{E} \times \mathrm{BTree} \to (\mathrm{N} \cup \{ \mathrm{ABSENT} \})$ | * $ \mathrm{depth} : \mathrm{E} \times \mathrm{BTree} \to (\mathrm{N} \cup \{ \mathrm{ABSENT} \})$ | ||
| * $ \mathrm{flatten} : \mathrm{BTree} \to \mathrm{List}$ | * $ \mathrm{flatten} : \mathrm{BTree} \to \mathrm{List}$ | ||
| Line 33: | Line 33: | ||
| \( | \( | ||
| - | \mathrm{rotate\text{-}right}(\mathrm{Node}(x, \mathrm{Node}(y, t1, t2), t3)) = \mathrm{Node}(y, t1, \mathrm{Node}(x t2,t3)) | + | \mathrm{rotate\text{-}right}(\mathrm{Node}(x, \mathrm{Node}(y, t1, t2), t3)) = \mathrm{Node}(y, t1, \mathrm{Node}(x, t2,t3)) |
| \) | \) | ||
| - | 3. Calculați complexitatea operației $ \mathrm{balanced_ins}$ studiată la curs. | + | 3. Calculați complexitatea operației $ \mathrm{balanced\_ins}$ studiată la curs. |
| 4. Care este cel mai eficient mod de a construi un arbore binar de căutare dintr-o listă. | 4. Care este cel mai eficient mod de a construi un arbore binar de căutare dintr-o listă. | ||