Skip to content

Commit

Permalink
Подготовка за следващата лекция
Browse files Browse the repository at this point in the history
  • Loading branch information
triffon committed Dec 6, 2024
1 parent a203ac4 commit 84a07ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion 3.3-searchtree.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

\title{Дървета за търсене}

\date{28 ноември 2024 г.}
\date[28.11--5.12.2024 г.]{28 ноември -- 5 декември 2024 г.}

\titlegraphicx{\includegraphics[height=0.25\textheight]{images/searchtree.jpg}\\
\imageAttr{Appletree}{User:MKFF}{https://commons.wikimedia.org/wiki/File:Appletree_2.jpg}{CC0}}
Expand Down
14 changes: 11 additions & 3 deletions 3.4-hash.tex
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
\documentclass[alsotrans,beameroptions={aspectratio=169}]{beamerswitch}
\usepackage{sdp}

% дали да показваме алгоритъма за двоично търсене
\newboolfalse{binarysearch}

% дали да показваме реализацията „сортиран списък“
\newboolfalse{sortedlist}

\title{Речници}

\date{28 ноември 2024 г.}
\date{5 декември 2024 г.}

\titlegraphicx{\includegraphics[height=0.25\textheight]{images/hash.jpg}\\
\imageBased{A Dictionary Of The English Language}{Jurriaan Persyn}{https://flic.kr/p/6ThMfe}{CC BY-NC 2.0}}
Expand Down Expand Up @@ -44,7 +50,7 @@ \section{АТД речник и реализации}
\end{itemize}
\end{frame}

\begin{frame}
\begin{frame}<\switch{sortedlist}>
\frametitle{Реализация: сортиран списък}
Свързан списък от двойки (ключ, стойност), сортиран по ключове (считаме, че имаме наредба по ключовете)
\pause
Expand All @@ -58,6 +64,7 @@ \section{АТД речник и реализации}
\begin{frame}
\frametitle{Реализация: сортиран масив}
Динамичен масив от двойки (ключ, стойност), сортиран по ключове\\
\ifbool{binarysearch}{%
\pause
Алгоритъм за двоично търсене:
\begin{enumerate}
Expand All @@ -69,6 +76,7 @@ \section{АТД речник и реализации}
\item ако \tt{Y < X} --- търсим \tt Y отляво, \tt{right = mid - 1} и към \ballref{\ref{it:start}}
\item ако \tt{Y > X} --- търсим \tt X отдясно, \tt{left = mid + 1} и към \ballref{\ref{it:start}}
\end{enumerate}
}{}
\pause
\begin{itemize}
\item \tt{lookup(key)} \onslide<+(1)->{--- $O(\log n)$, можем да използваме двоично търсене}
Expand Down Expand Up @@ -100,7 +108,7 @@ \section{АТД речник и реализации}
\end{itemize}
\end{itemize}
\end{frame}

\end{document}
\section{Хеш таблица}

\begin{frame}
Expand Down

0 comments on commit 84a07ac

Please sign in to comment.