Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
chore: format slides
Browse files Browse the repository at this point in the history
  • Loading branch information
storopoli committed Dec 9, 2024
1 parent bc7b523 commit c90add2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 41 deletions.
26 changes: 7 additions & 19 deletions slides/slides-pt.typ
Original file line number Diff line number Diff line change
Expand Up @@ -2289,9 +2289,7 @@ proposicional pode ser tornada verdadeira* por meio de uma atribuição adequada
supplement: [Algoritmo],
caption: [_Bubble Sort_],
text(size: 12pt)[
#pseudocode-list(
title: smallcaps[Dado um _array_ $A$ de $n$ elementos:],
)[
#pseudocode-list(title: smallcaps[Dado um _array_ $A$ de $n$ elementos:])[
+ *para* $i$ de $0$ até $n - 1$:
+ *para* $j$ de $0$ até $n - i - 1$:
+ *se* $A[j] > A[j + 1]$:
Expand Down Expand Up @@ -2373,9 +2371,7 @@ proposicional pode ser tornada verdadeira* por meio de uma atribuição adequada
supplement: [Algoritmo],
caption: [_Selection Sort_],
text(size: 12pt)[
#pseudocode-list(
title: smallcaps[Dado um _array_ $A$ de $n$ elementos:],
)[
#pseudocode-list(title: smallcaps[Dado um _array_ $A$ de $n$ elementos:])[
+ *para* $i$ de $0$ até $n - 1$:
+ $"minIdx" := i$
+ *para* $j$ de $i + 1$ até $n$:
Expand Down Expand Up @@ -2458,9 +2454,7 @@ proposicional pode ser tornada verdadeira* por meio de uma atribuição adequada
supplement: [Algoritmo],
caption: [_Insertion Sort_],
text(size: 12pt)[
#pseudocode-list(
title: smallcaps[Dado um _array_ $A$ de $n$ elementos:],
)[
#pseudocode-list(title: smallcaps[Dado um _array_ $A$ de $n$ elementos:])[
+ *para* $i$ de $1$ até $n - 1$:
+ $"key" := A[i]$
+ $j := i - 1$
Expand Down Expand Up @@ -2787,9 +2781,7 @@ proposicional pode ser tornada verdadeira* por meio de uma atribuição adequada
supplement: [Algoritmo],
caption: [_Heap Sort_],
text(size: 12pt)[
#pseudocode-list(
title: smallcaps[Função heap_sort(_array_ A, n):],
)[
#pseudocode-list(title: smallcaps[Função heap_sort(_array_ A, n):])[
+ *para* $i$ de $n / 2 - 1$ até $0$:
+ heapify(A, n, i)
+ *para* $i$ de $n - 1$ até $0$:
Expand Down Expand Up @@ -2916,9 +2908,7 @@ proposicional pode ser tornada verdadeira* por meio de uma atribuição adequada
supplement: [Algoritmo],
caption: [_Counting Sort_],
text(size: 10pt)[
#pseudocode-list(
title: smallcaps[Dado um _array_ $A$ de $n$ elementos:],
)[
#pseudocode-list(title: smallcaps[Dado um _array_ $A$ de $n$ elementos:])[
+ $max := "find_max"(A)$
+ inicialize o _array_ de contagem $C[0..max]$
+ *para* cada elemento em $A$:
Expand Down Expand Up @@ -3014,9 +3004,7 @@ proposicional pode ser tornada verdadeira* por meio de uma atribuição adequada
supplement: [Algoritmo],
caption: [Radix Sort],
text(size: 12pt)[
#pseudocode-list(
title: smallcaps[Função radix_sort(_array_ A, n):],
)[
#pseudocode-list(title: smallcaps[Função radix_sort(_array_ A, n):])[
+ $max := "find_max"(A)$
+ *para* $"exp" := 1$; $floor("max" / "exp") > 0$; $"exp" *= 10$:
+ $"counting_sort_by_digit"(A, n, "exp")$
Expand Down Expand Up @@ -4135,4 +4123,4 @@ proposicional pode ser tornada verdadeira* por meio de uma atribuição adequada
- *Tarefa:* Implementar o algoritmo de LCS (Subsequência Comum Máxima) e analisar sua complexidade.
- *Tarefa:* Resolver o Problema do Corte de Hastes usando programação dinâmica e comparar com a abordagem recursiva simples.
- *Tarefa:* Identificar um problema real que pode ser otimizado usando programação dinâmica e desenvolver a solução.
]
]
30 changes: 8 additions & 22 deletions slides/slides.typ
Original file line number Diff line number Diff line change
Expand Up @@ -2268,9 +2268,7 @@ subtrees is at most 1.
supplement: [Algorithm],
caption: [Bubble Sort],
text(size: 12pt)[
#pseudocode-list(
title: smallcaps[Given an array $A$ of $n$ elements:],
)[
#pseudocode-list(title: smallcaps[Given an array $A$ of $n$ elements:])[
+ *for* $i$ from $0$ to $n - 1$:
+ *for* $j$ from $0$ to $n - i - 1$:
+ *if* $A[j] > A[j + 1]$:
Expand Down Expand Up @@ -2351,9 +2349,7 @@ subtrees is at most 1.
supplement: [Algorithm],
caption: [Selection Sort],
text(size: 12pt)[
#pseudocode-list(
title: smallcaps[Given an array $A$ of $n$ elements:],
)[
#pseudocode-list(title: smallcaps[Given an array $A$ of $n$ elements:])[
+ *for* $i$ from $0$ to $n - 1$:
+ $"minIdx" := i$
+ *for* $j$ from $i + 1$ to $n$:
Expand Down Expand Up @@ -2436,9 +2432,7 @@ subtrees is at most 1.
supplement: [Algorithm],
caption: [Insertion Sort],
text(size: 12pt)[
#pseudocode-list(
title: smallcaps[Given an array $A$ of $n$ elements:],
)[
#pseudocode-list(title: smallcaps[Given an array $A$ of $n$ elements:])[
+ *for* $i$ from $1$ to $n - 1$:
+ $"key" := A[i]$
+ $j := i - 1$
Expand Down Expand Up @@ -2765,9 +2759,7 @@ subtrees is at most 1.
supplement: [Algorithm],
caption: [Heap Sort],
text(size: 12pt)[
#pseudocode-list(
title: smallcaps[Function heap_sort(array A, n):],
)[
#pseudocode-list(title: smallcaps[Function heap_sort(array A, n):])[
+ *for* $i$ from $n / 2 - 1$ down to $0$:
+ heapify(A, n, i)
+ *for* $i$ from $n - 1$ down to $0$:
Expand Down Expand Up @@ -2894,9 +2886,7 @@ subtrees is at most 1.
supplement: [Algorithm],
caption: [Counting Sort],
text(size: 10pt)[
#pseudocode-list(
title: smallcaps[Given an array $A$ of $n$ elements:],
)[
#pseudocode-list(title: smallcaps[Given an array $A$ of $n$ elements:])[
+ $max := "find_max"(A)$
+ initialize count array $C[0..max]$
+ *for* each element in $A$:
Expand Down Expand Up @@ -2992,9 +2982,7 @@ subtrees is at most 1.
supplement: [Algorithm],
caption: [Radix Sort],
text(size: 12pt)[
#pseudocode-list(
title: smallcaps[Function radix_sort(array A, n):],
)[
#pseudocode-list(title: smallcaps[Function radix_sort(array A, n):])[
+ $max := "find_max"(A)$
+ *for* $"exp" := 1$; $floor("max" / "exp") > 0$; $"exp" *= 10$:
+ $"counting_sort_by_digit"(A, n, "exp")$
Expand Down Expand Up @@ -3480,9 +3468,7 @@ subtrees is at most 1.
supplement: [Algorithm],
caption: [Example of Recursion],
text(size: 12pt)[
#pseudocode-list(
title: smallcaps[Procedure $p$(input $x$ of size $n$)],
)[
#pseudocode-list(title: smallcaps[Procedure $p$(input $x$ of size $n$)])[
+ *if* $n < "some constant" k$:
+ solve $x$ directly, without recursion
+ *else*:
Expand Down Expand Up @@ -4113,4 +4099,4 @@ subtrees is at most 1.
- *Task*: Implement the LCS (Longest Common Subsequence) algorithm and analyze its complexity.
- *Task*: Solve the Rod Cutting Problem using dynamic programming and compare with the simple recursive approach.
- *Task*: Identify a real-world problem that can be optimized using dynamic programming and develop the solution.
]
]

0 comments on commit c90add2

Please sign in to comment.