This shows you the differences between two versions of the page.
pa:laboratoare:laborator-00 [2025/02/24 23:07] darius.neatu [Exercitii] |
pa:laboratoare:laborator-00 [2025/03/06 22:57] (current) darius.neatu [Exercitii] |
||
---|---|---|---|
Line 121: | Line 121: | ||
3. Răspunsul este minimul din heap la finalul parcurgerii. | 3. Răspunsul este minimul din heap la finalul parcurgerii. | ||
- | Complexitate este de $ O(n log k) $, care este mai bună. Aceasta este soluția optimă. | + | Complexitate este de $ O(n log k) $, care este mai bună. Implementați și testați pe Leetcode! |
- | + | ||
- | Implementați și testați pe Leetcode! | + | |
</spoiler> | </spoiler> | ||
+ | <spoiler Soluția 3> | ||
+ | Hint: Soluția 2 nu este optimă! Se poate și $O(n)$, dar considerăm că este înafara scopului laboratorului 0. | ||
+ | </spoiler> | ||
* **Task02**: Discutați problema [[https://leetcode.com/problems/sliding-window-maximum/| Sliding Window Maximum]] și problema [[https://leetcode.com/problems/longest-substring-without-repeating-characters| Longest Substring without repeating characters]]. Implementați și testați cel puțin o problemă. | * **Task02**: Discutați problema [[https://leetcode.com/problems/sliding-window-maximum/| Sliding Window Maximum]] și problema [[https://leetcode.com/problems/longest-substring-without-repeating-characters| Longest Substring without repeating characters]]. Implementați și testați cel puțin o problemă. | ||
* **Task03**: Rezolvați problema [[https://leetcode.com/problems/min-stack/description/| Min Stack]]. | * **Task03**: Rezolvați problema [[https://leetcode.com/problems/min-stack/description/| Min Stack]]. |