-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththalg_notes.tex
265 lines (231 loc) · 7.42 KB
/
thalg_notes.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
% Geometry setup
\documentclass[a4paper]{article}
\usepackage[margin=1.5cm]{geometry}
% Language setup
\usepackage[T1]{fontenc} % Output character encoding
\usepackage[utf8]{inputenc} % Input character encoding
% Spacing setup
\setlength{\parindent}{0pt} % No paragraph indenting
\setlength{\parskip}{5pt} % Set spacing between paragraphs
\frenchspacing
\newcommand{\rmspace}{\vspace{-19pt}}
% Dependency setup
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{dsfont}
\usepackage{listings}
\usepackage{float}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{url}
\usepackage[comma,authoryear]{natbib}
\usepackage[shortlabels]{enumitem}
\usepackage{minted}
\usepackage{makecell}
\usepackage{stmaryrd}
\DeclarePairedDelimiter{\ceil}{\lceil}{\rceil}
% Code pretty print
\usepackage{minted}
% Hyperlink format
\usepackage{xcolor}
\hypersetup{
colorlinks,
linkcolor={red!50!black},
citecolor={blue!50!black},
urlcolor={blue!80!black}
}
% Title setup
\author{Viktória Nemkin ([email protected])}
\title{Practice Session Notes: Theory of Algorithms}
% Custom commands
\newcommand{\lineparagraph}[1]{\paragraph{#1}\mbox{}\\}
\newcommand{\titlemath}[1]{\texorpdfstring{#1}{Lg}}
\newcommand{\separate}{\vspace{2mm}\hrulefill{}\vspace{2mm}}
\newcommand{\condition}{\text{, }~}
% Supress warnings
\hbadness=99999 % Underfull hbox
% Document
\begin{document}
\maketitle
These, are my practice session notes, they are based on my personal notes and on the Hungarian course's solutions, found here under the heading \textbf{''A gyakorlatokon használt feladatsorok''}:\\ \url{http://www.cs.bme.hu/~csima/algel2020/index_2020_tavasz_vegleges.html} $\rightarrow$ In the case of hashings, this guide uses open hashings with quadratic probing by starting from the left, while we start that one to the right. Check Session 13, Exercise 9 for details!
This is a work in progress, I am updating these whenever I have time.
\textbf{Mistakes are possible}, if you spot any or if you have any questions about these notes, please contact me at [email protected] or in MS Teams.
\textbf{Version log}: \href{https://github.com/nemkin/thalg-notes/commits/main}{https://github.com/nemkin/thalg-notes/commits/main} - So you can check what was updated and when. (Or send me a PR if you find any errors? :) )
\tableofcontents
\pagebreak
\section{February 16th (Session 1): O, \titlemath{$\Omega$, $\Theta$}, pattern matching}
\input{01/01}\pagebreak
\input{01/02}\pagebreak
\input{01/03}\pagebreak
\input{01/04}\pagebreak
\input{01/05}\pagebreak
\input{01/06}\pagebreak
\input{01/07}\pagebreak
\input{01/08}\pagebreak
\input{01/09}\pagebreak
\input{01/10}\pagebreak
\input{01/11}\pagebreak
\input{01/12}\pagebreak
\section{February 23rd (Session 2): Finite Automata}
\input{02/01}\pagebreak
\input{02/02}\pagebreak
\input{02/03}\pagebreak
\input{02/04}\pagebreak
\input{02/05}\pagebreak
\input{02/06}\pagebreak
\input{02/07}\pagebreak
\input{02/08}\pagebreak
\input{02/09}\pagebreak
\input{02/10}\pagebreak
\input{02/11}\pagebreak
\input{02/12}\pagebreak
\input{02/13}\pagebreak
\section{March 2nd (Session 3): Regular expressions, Context-free languages}
\input{03/01}\pagebreak
\input{03/02}\pagebreak
\input{03/03}\pagebreak
\input{03/04}\pagebreak
\input{03/05}\pagebreak
\input{03/06}\pagebreak
\input{03/07}\pagebreak
\input{03/08}\pagebreak
\input{03/09}\pagebreak
\input{03/10}\pagebreak
\input{03/11}\pagebreak
\input{03/12}\pagebreak
\section{March 9th (Session 4): Context-free grammars, Pushdown automata}
\input{04/01}\pagebreak
\input{04/02}\pagebreak
\input{04/03}\pagebreak
\input{04/04}\pagebreak
\input{04/05}\pagebreak
\input{04/06}\pagebreak
\input{04/07}\pagebreak
\input{04/08}\pagebreak
\input{04/09}\pagebreak
\input{04/10}\pagebreak
\input{04/11}\pagebreak
\input{04/12}\pagebreak
\section{March 23th (Session 5): Turing-machines}
\input{05/01}\pagebreak
\input{05/02}\pagebreak
\input{05/03}\pagebreak
\input{05/04}\pagebreak
\input{05/05}\pagebreak
\input{05/06}\pagebreak
\input{05/07}\pagebreak
\input{05/08}\pagebreak
\input{05/09}\pagebreak
\section{March 30th (Session 6): Turing-machines 2}
\input{06/01}\pagebreak
\input{06/02}\pagebreak
\input{06/03}\pagebreak
\input{06/04}\pagebreak
\input{06/05}\pagebreak
\input{06/06}\pagebreak
\input{06/07}\pagebreak
\input{06/08}\pagebreak
\section{April 6th (Session 7): P, NP}
\input{07/01}\pagebreak
\input{07/02}\pagebreak
\input{07/03}\pagebreak
\input{07/04}\pagebreak
\input{07/05}\pagebreak
\input{07/06}\pagebreak
\input{07/07}\pagebreak
\input{07/08}\pagebreak
\input{07/09}\pagebreak
\section{April 13th (Session 8): NP-completeness}
\input{08/karp}\pagebreak
\input{08/01}\pagebreak
\input{08/02}\pagebreak
\input{08/03}\pagebreak
\input{08/04}\pagebreak
\input{08/05}\pagebreak
\input{08/06}\pagebreak
\input{08/07}\pagebreak
\input{08/08}\pagebreak
\input{08/09}\pagebreak
\input{08/10}\pagebreak
\input{08/11}\pagebreak
\input{08/12}\pagebreak
\section{April 27th (Session 9): NP-completeness, Integer Programming, Linear Programming}
\input{09/01}\pagebreak
\input{09/02}\pagebreak
\input{09/03}\pagebreak
\input{09/04}\pagebreak
\input{09/05}\pagebreak
\input{09/06}\pagebreak
\input{09/07}\pagebreak
\input{09/08}\pagebreak
\input{09/09}\pagebreak
\input{09/10}\pagebreak
\section{May 5th (Session 10): Binpacking FF/FFD, Dynamic Programming}
\input{10/01}\pagebreak
\input{10/02}\pagebreak
\input{10/03}\pagebreak
\input{10/04}\pagebreak
\input{10/05}\pagebreak
\input{10/06}\pagebreak
\input{10/07}\pagebreak
\input{10/07}\pagebreak
\input{10/08}\pagebreak
\input{10/09}\pagebreak
\input{10/10}\pagebreak
\input{10/11}\pagebreak
\pagebreak
\section{May 11th (Session 11): Sorting, Binary Search Trees}
\input{11/01}\pagebreak
\input{11/02}\pagebreak
\input{11/03}\pagebreak
\input{11/04}\pagebreak
\input{11/05}\pagebreak
\input{11/06}\pagebreak
\input{11/07}\pagebreak
\input{11/08}\pagebreak
\input{11/09}\pagebreak
\input{11/10}\pagebreak
\input{11/11}\pagebreak
\input{11/12}\pagebreak
\input{11/13}\pagebreak
\input{11/14}\pagebreak
\input{11/15}\pagebreak
\section{May 18th (Session 12): Binary Search Trees, 2-3-trees, Hash}
\subsection{Solutions written by Prof. Attila Sali, on Moodle}
Solutions to May 18th (Session 12): Binary Search Trees, 2-3-trees, Hash: \href{https://edu.vik.bme.hu/pluginfile.php/325461/mod\_resource/content/1/main.pdf}{To Moodle}.
\pagebreak
\input{12/09}\pagebreak
\section{Exam: 2019. 01. 06.}
\input{exams/2019_01_06/01}\pagebreak
\section{Exam: 2019. 06. 17.}
\setcounter{subsection}{3}
\input{exams/2019_06_17/04}\pagebreak
\section{Exam: 2020. 01. 23.}
\setcounter{subsection}{2}
\input{exams/2020_01_23/03}\pagebreak
\section{Exam: 2022. 05. 30.}
\input{exams/2022_05_30/01}\pagebreak
\input{exams/2022_05_30/02}\pagebreak
\input{exams/2022_05_30/03}\pagebreak
\input{exams/2022_05_30/04}\pagebreak
\input{exams/2022_05_30/05}\pagebreak
\input{exams/2022_05_30/06}\pagebreak
\input{exams/2022_05_30/07}\pagebreak
\section{Exam: 2022. 06. 13.}
\input{exams/2022_06_13/01}\pagebreak
\input{exams/2022_06_13/02}\pagebreak
\input{exams/2022_06_13/03}\pagebreak
\input{exams/2022_06_13/04}\pagebreak
\input{exams/2022_06_13/05}\pagebreak
\input{exams/2022_06_13/06}\pagebreak
\section{Exam: 2022. 06. 20.}
\input{exams/2022_06_20/01}\pagebreak
\input{exams/2022_06_20/02}\pagebreak
\input{exams/2022_06_20/03}\pagebreak
\input{exams/2022_06_20/04}\pagebreak
\input{exams/2022_06_20/05}\pagebreak
\input{exams/2022_06_20/06}\pagebreak
\input{exams/2022_06_20/07}\pagebreak
\end{document}