Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
aa:lab:sol:12 [2024/01/14 17:34]
dmihai created
aa:lab:sol:12 [2026/01/19 13:01] (current)
dmihai
Line 1: Line 1:
-1. +====== ​Abordări practice pentru probleme NP-Complete ​====== 
- +   
-    (APP1) append(Empty,​ l) +{{:​aa:​lab:​sol:​kernelization-sol.zip|}}
-    (APP2) append(Cons(x,​ xs), l) Cons(x, append(xs, l)) +
- +
-    (REV1) reverse(Empty) ​Empty +
-    (REV2) reverse(Cons(x,​ xs)) append(reverse(xs),​ Cons(x, Empty)) +
- +
-2. +
- +
-    (M1) mirror(Nil) ​Nil +
-    (M2) mirror(Node(e,​ l, r))  ​Node(e,​ mirror(r), mirror(l)) +
- +
-    (F1) flatten(Nil) ​Empty +
-    (F2) flatten(Node(e,​ l, r)) Cons(e, append(flatten(l),​ flatten(r))) +
- +
-3.  +
- +
-    (UPD1) update(MEmpty,​ k, v) Insert((k, v), MEmpty) +
-    (UPD2) update(Insert((k,​ v), m), k', v'​) ​if k k' then Insert((k, v'), m) +
-                                                         else Insert((k, v), update(m, k', v')) +
- +
-    (DEL1) delete(MEmpty,​ k) MEmpty +
-    (DEL2) delete(Insert((k,​ v), m), k') = if k = k' then m +
-                                                     else Insert((k, v), delete(m, k')) +
- +