diff --git a/index.markdown b/index.markdown index 4bae8ba..aa38f64 100644 --- a/index.markdown +++ b/index.markdown @@ -52,10 +52,10 @@ Students should be able to understand the relationship between algorithm design, - __27 Oct 23__: Average time complexity and analysis of the quicksort algorithm ([4-average-time.pdf - pages 20-32](slides/4-average-time.pdf)); Randomised algorithms ([4-average-time.pdf - pages 33-40](slides/4-average-time.pdf)); Amortised analysis and the aggregate method ([5-amortised.pdf - pages 1-11](slides/5-amortised.pdf)) - __10 Nov 23__: Test (30%): 9h30-10h30 (Specification, Correction, Worst/Best time analysis, Asymptotic analysis); Rest of the lesson starts at 11h15 - Amortised analysis ([5-amortised.pdf - pages 11-26](slides/5-amortised.pdf)) - __17 Nov 23__: Amortised analysis ([5-amortised.pdf - pages 27-44](slides/5-amortised.pdf)); Data structures: sequences ([6-data-structures.pdf - pages 1-8](slides/6-data-structures.pdf)) -- __24 Nov 23__: Data structures: buffers and dictionaries +- __24 Nov 23__: Data structures: buffers and dictionaries ([6-data-structures.pdf - pages 9-28](slides/6-data-structures.pdf)) - __1 Dec 23__: _Holiday_ - __8 Dec 23__: _Holiday_ -- __15 Dec 23__: Test (70%): 9h30-11h30 (all topics); no lesson after the test +- __15 Dec 23__: Improvement test (70%): 9h30-11h30 (focused on average-time, amortised time, and data structures, but all topics can be asked); no lesson after the test diff --git a/slides/6-data-structures.pdf b/slides/6-data-structures.pdf index a88c086..e7341e3 100644 Binary files a/slides/6-data-structures.pdf and b/slides/6-data-structures.pdf differ diff --git a/slides/6-data-structures.tex b/slides/6-data-structures.tex index c033979..902a8e5 100755 --- a/slides/6-data-structures.tex +++ b/slides/6-data-structures.tex @@ -205,7 +205,7 @@ \section{Sets and Sequences} LInt pt = l; while (pt != NULL) pt = pt->next; pt = malloc(sizeof(struct list)); - pt -> next = x; + pt -> value = x; pt -> next = NULL ; return l ; } @@ -249,10 +249,10 @@ \section{Sets and Sequences} while (pt != NULL) { prev = pt; pt = pt->next; } pt = malloc(sizeof(struct list)); - pt->next = x; + pt->value = x; pt->next = NULL ; if (l==NULL) l = pt; - else prev->prox = pt; + else prev->next = pt; return l; } \end{lstlisting} @@ -492,7 +492,7 @@ \section{Buffers (stacks and queueus)} % \begin{itemize} \item Binary tree - \item Each node is larger than any of its children + \item Each node is smaller than any of its children \item Implemented as an array \end{itemize} % @@ -771,6 +771,8 @@ \section{Dictionaries} \\What is their complexity?} \end{frame} +\section{Dictionaries with trees -- not for evaluation} + % \section{Balanced trees} \begin{frame}\frametitle{More dictionaries: balanced trees} @@ -807,7 +809,6 @@ \section{Dictionaries} \end{frame} - \begin{frame}\frametitle{Binary Balanced Search Trees} \begin{columns}[t]