Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bdc211f

Browse files
committed
+2-12-hashing: +ot
1 parent c499425 commit bdc211f

File tree

9 files changed

+2429
-0
lines changed

9 files changed

+2429
-0
lines changed
51.9 KB
Binary file not shown.
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
% 2-12-hashing.tex
2+
3+
%%%%%%%%%%%%%%%%%%%%
4+
\documentclass[a4paper, justified]{tufte-handout}
5+
6+
\input{hw-preamble} % feel free to modify this file
7+
%%%%%%%%%%%%%%%%%%%%
8+
\title{第12讲: Hashing 方法}
9+
\me{魏恒峰}{hfwei@nju.edu.cn}{}{}
10+
\date{\zhtoday} % or like 2019年9月13日
11+
%%%%%%%%%%%%%%%%%%%%
12+
\begin{document}
13+
\maketitle
14+
%%%%%%%%%%%%%%%%%%%%
15+
\noplagiarism % always keep this line
16+
%%%%%%%%%%%%%%%%%%%%
17+
\begin{abstract}
18+
% \begin{center}{\fcolorbox{blue}{yellow!60}{\parbox{0.65\textwidth}{\large
19+
% \begin{itemize}
20+
% \item
21+
% \end{itemize}}}}
22+
% \end{center}
23+
\end{abstract}
24+
%%%%%%%%%%%%%%%%%%%%
25+
\beginrequired
26+
27+
%%%%%%%%%%%%%%%
28+
\begin{problem}[TC ]
29+
\end{problem}
30+
31+
\begin{solution}
32+
\end{solution}
33+
%%%%%%%%%%%%%%%
34+
35+
36+
%%%%%%%%%%%%%%%
37+
\begin{problem}[TC ]
38+
\end{problem}
39+
40+
\begin{solution}
41+
\end{solution}
42+
%%%%%%%%%%%%%%%
43+
44+
%%%%%%%%%%%%%%%
45+
\begin{problem}[TC ]
46+
\end{problem}
47+
48+
\begin{solution}
49+
\end{solution}
50+
%%%%%%%%%%%%%%%
51+
52+
%%%%%%%%%%%%%%%
53+
\begin{problem}[TC ]
54+
\end{problem}
55+
56+
\begin{solution}
57+
\end{solution}
58+
%%%%%%%%%%%%%%%
59+
60+
%%%%%%%%%%%%%%%
61+
\begin{problem}[TC ]
62+
\end{problem}
63+
64+
\begin{solution}
65+
\end{solution}
66+
%%%%%%%%%%%%%%%
67+
68+
%%%%%%%%%%%%%%%
69+
\begin{problem}[TC ]
70+
\end{problem}
71+
72+
\begin{solution}
73+
\end{solution}
74+
%%%%%%%%%%%%%%%
75+
76+
%%%%%%%%%%%%%%%
77+
\begin{problem}[TC ]
78+
\end{problem}
79+
80+
\begin{solution}
81+
\end{solution}
82+
%%%%%%%%%%%%%%%
83+
84+
%%%%%%%%%%%%%%%
85+
\begin{problem}[TC ]
86+
\end{problem}
87+
88+
\begin{solution}
89+
\end{solution}
90+
%%%%%%%%%%%%%%%
91+
92+
%%%%%%%%%%%%%%%
93+
\begin{problem}[TC ]
94+
\end{problem}
95+
96+
\begin{solution}
97+
\end{solution}
98+
%%%%%%%%%%%%%%%
99+
100+
%%%%%%%%%%%%%%%%%%%%
101+
\beginoptional
102+
103+
%%%%%%%%%%%%%%%
104+
\begin{problem}[]
105+
\end{problem}
106+
107+
\begin{solution}
108+
\end{solution}
109+
%%%%%%%%%%%%%%%
110+
111+
%%%%%%%%%%%%%%%%%%%%
112+
\beginot
113+
114+
%%%%%%%%%%%%%%%
115+
\begin{ot}[Perfect Hashing]
116+
介绍 Perfect hashing。
117+
118+
\noindent 参考资料:
119+
\begin{itemize}
120+
\item Section 11.5 of CLRS
121+
\end{itemize}
122+
\end{ot}
123+
124+
% \begin{solution}
125+
% \end{solution}
126+
%%%%%%%%%%%%%%%
127+
% \vspace{0.50cm}
128+
%%%%%%%%%%%%%%%
129+
\begin{ot}[Bloom filter]
130+
介绍 Bloom filter。
131+
132+
\noindent 参考资料:
133+
\begin{itemize}
134+
\item \href{https://en.wikipedia.org/wiki/Bloom\_filter}{Bloom filter @ wiki}
135+
\end{itemize}
136+
\end{ot}
137+
138+
% \begin{solution}
139+
% \end{solution}
140+
%%%%%%%%%%%%%%%
141+
142+
%%%%%%%%%%%%%%%%%%%%
143+
% 如果没有需要订正的题目,可以把这部分删掉
144+
145+
% \begincorrection
146+
%%%%%%%%%%%%%%%%%%%%
147+
148+
%%%%%%%%%%%%%%%%%%%%
149+
% 如果没有反馈,可以把这部分删掉
150+
\beginfb
151+
152+
% 你可以写
153+
% ~\footnote{优先推荐 \href{problemoverflow.top}{ProblemOverflow}}:
154+
% \begin{itemize}
155+
% \item 对课程及教师的建议与意见
156+
% \item 教材中不理解的内容
157+
% \item 希望深入了解的内容
158+
% \item $\cdots$
159+
% \end{itemize}
160+
%%%%%%%%%%%%%%%%%%%%
161+
% \bibliography{2-5-solving-recurrence}
162+
% \bibliographystyle{plainnat}
163+
%%%%%%%%%%%%%%%%%%%%
164+
\end{document}

‎2019/2019-2/2-12-hashing/2-12-hashing.tex.latexmain‎

Whitespace-only changes.

‎2019/2019-2/2-12-hashing/README.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# README.md
2+
3+
## Homework
4+
5+
### OLD
6+
- CS 第 5.5 节问题 8、14
7+
- TC 第 11.2 节练习 3、6
8+
- TC 第 11.3 节练习 3、4
9+
- TC 第 11.4 节练习 2、3
10+
- TC 第 11 章问题 1、2
11+
12+
### NEW
13+
14+
### Additional
15+
16+
## OT
17+
18+
### OLD
19+
- Universal Hashing
20+
- Hashing 故事
21+
22+
### NEW
23+
- Perfect Hashing
24+
- Bloom filter
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
% hw-preamble.tex
2+
3+
% geometry for A4 paper
4+
% See https://tex.stackexchange.com/a/119912/23098
5+
\geometry{
6+
left=20.0mm,
7+
top=20.0mm,
8+
bottom=20.0mm,
9+
textwidth=130mm, % main text block
10+
marginparsep=5.0mm, % gutter between main text block and margin notes
11+
marginparwidth=50.0mm % width of margin notes
12+
}
13+
14+
% for colors
15+
\usepackage{xcolor} % usage: \color{red}{text}
16+
% predefined colors
17+
\newcommand{\red}[1]{\textcolor{red}{#1}} % usage: \red{text}
18+
\newcommand{\blue}[1]{\textcolor{blue}{#1}}
19+
\newcommand{\teal}[1]{\textcolor{teal}{#1}}
20+
21+
\usepackage{todonotes}
22+
23+
% heading
24+
\usepackage{sectsty}
25+
\setcounter{secnumdepth}{2}
26+
\allsectionsfont{\centering\huge\rmfamily}
27+
28+
% for Chinese
29+
\usepackage{xeCJK}
30+
\usepackage{zhnumber}
31+
\setCJKmainfont[BoldFont=FandolSong-Bold.otf]{FandolSong-Regular.otf}
32+
33+
% for fonts
34+
\usepackage{fontspec}
35+
\newcommand{\song}{\CJKfamily{song}}
36+
\newcommand{\kai}{\CJKfamily{kai}}
37+
38+
% To fix the ``MakeTextLowerCase'' bug:
39+
% See https://github.com/Tufte-LaTeX/tufte-latex/issues/64#issuecomment-78572017
40+
% Set up the spacing using fontspec features
41+
\renewcommand\allcapsspacing[1]{{\addfontfeature{LetterSpace=15}#1}}
42+
\renewcommand\smallcapsspacing[1]{{\addfontfeature{LetterSpace=10}#1}}
43+
44+
% for url
45+
\usepackage{hyperref}
46+
\hypersetup{colorlinks = true,
47+
linkcolor = teal,
48+
urlcolor = teal,
49+
citecolor = blue,
50+
anchorcolor = blue}
51+
52+
\newcommand{\me}[4]{
53+
\author{
54+
{\bfseries 姓名:}\underline{#1}\hspace{2em}
55+
{\bfseries 学号:}\underline{#2}\hspace{2em}\\[10pt]
56+
{\bfseries 评分:}\underline{#3\hspace{3em}}\hspace{2em}
57+
{\bfseries 评阅:}\underline{#4\hspace{3em}}
58+
}
59+
}
60+
61+
% Please ALWAYS Keep This.
62+
\newcommand{\noplagiarism}{
63+
\begin{center}
64+
\fbox{\begin{tabular}{@{}c@{}}
65+
请独立完成作业,不得抄袭。\\
66+
若得到他人帮助, 请致谢。\\
67+
若参考了其它资料,请给出引用。\\
68+
鼓励讨论,但需独立书写解题过程。
69+
\end{tabular}}
70+
\end{center}
71+
}
72+
73+
\newcommand{\goal}[1]{
74+
\begin{center}{\fcolorbox{blue}{yellow!60}{\parbox{0.50\textwidth}{\large
75+
\begin{itemize}
76+
\item 体会``思维的乐趣''
77+
\item 初步了解递归与数学归纳法
78+
\item 初步接触算法概念与问题下界概念
79+
\end{itemize}}}}
80+
\end{center}
81+
}
82+
83+
% Each hw consists of four parts:
84+
\newcommand{\beginrequired}{\hspace{5em}\section{作业 (必做部分)}}
85+
\newcommand{\beginoptional}{\section{作业 (选做部分)}}
86+
\newcommand{\beginot}{\section{Open Topics}}
87+
\newcommand{\begincorrection}{\section{订正}}
88+
\newcommand{\beginfb}{\section{反馈}}
89+
90+
% for math
91+
\usepackage{amsmath, mathtools, amsfonts, amssymb}
92+
\newcommand{\set}[1]{\{#1\}}
93+
94+
% define theorem-like environments
95+
\usepackage[amsmath, thmmarks]{ntheorem}
96+
97+
\theoremstyle{break}
98+
\theorempreskip{2.0\topsep}
99+
\theorembodyfont{\song}
100+
\theoremseparator{}
101+
\newtheorem{problem}{题目}[subsection]
102+
\renewcommand{\theproblem}{\arabic{problem}}
103+
\newtheorem{ot}{Open Topics}
104+
105+
\theorempreskip{3.0\topsep}
106+
\theoremheaderfont{\kai\bfseries}
107+
\theoremseparator{:}
108+
\theorempostwork{\bigskip\hrule}
109+
\newtheorem*{solution}{解答}
110+
\theorempostwork{\bigskip\hrule}
111+
\newtheorem*{revision}{订正}
112+
113+
\theoremstyle{plain}
114+
\newtheorem*{cause}{错因分析}
115+
\newtheorem*{remark}{注}
116+
117+
\theoremstyle{break}
118+
\theorempostwork{\bigskip\hrule}
119+
\theoremsymbol{\ensuremath{\Box}}
120+
\newtheorem*{proof}{证明}
121+
122+
% \newcommand{\ot}{\blue{\bf [OT]}}
123+
124+
% for figs
125+
\renewcommand\figurename{图}
126+
\renewcommand\tablename{表}
127+
128+
% for fig without caption: #1: width/size; #2: fig file
129+
\newcommand{\fig}[2]{
130+
\begin{figure}[htbp]
131+
\centering
132+
\includegraphics[#1]{#2}
133+
\end{figure}
134+
}
135+
% for fig with caption: #1: width/size; #2: fig file; #3: caption
136+
\newcommand{\figcap}[3]{
137+
\begin{figure}[htbp]
138+
\centering
139+
\includegraphics[#1]{#2}
140+
\caption{#3}
141+
\end{figure}
142+
}
143+
% for fig with both caption and label: #1: width/size; #2: fig file; #3: caption; #4: label
144+
\newcommand{\figcaplbl}[4]{
145+
\begin{figure}[htbp]
146+
\centering
147+
\includegraphics[#1]{#2}
148+
\caption{#3}
149+
\label{#4}
150+
\end{figure}
151+
}
152+
% for margin fig without caption: #1: width/size; #2: fig file
153+
\newcommand{\mfig}[2]{
154+
\begin{marginfigure}
155+
\centering
156+
\includegraphics[#1]{#2}
157+
\end{marginfigure}
158+
}
159+
% for margin fig with caption: #1: width/size; #2: fig file; #3: caption
160+
\newcommand{\mfigcap}[3]{
161+
\begin{marginfigure}
162+
\centering
163+
\includegraphics[#1]{#2}
164+
\caption{#3}
165+
\end{marginfigure}
166+
}
167+
168+
\usepackage{fancyvrb}
169+
170+
% for algorithms
171+
\usepackage[]{algorithm}
172+
\usepackage[]{algpseudocode} % noend
173+
% See [Adjust the indentation whithin the algorithmicx-package when a line is broken](https://tex.stackexchange.com/a/68540/23098)
174+
\newcommand{\algparbox}[1]{\parbox[t]{\dimexpr\linewidth-\algorithmicindent}{#1\strut}}
175+
\newcommand{\hStatex}[0]{\vspace{5pt}}
176+
\makeatletter
177+
\newlength{\trianglerightwidth}
178+
\settowidth{\trianglerightwidth}{$\triangleright$~}
179+
\algnewcommand{\LineComment}[1]{\Statex \hskip\ALG@thistlm \(\triangleright\) #1}
180+
\algnewcommand{\LineCommentCont}[1]{\Statex \hskip\ALG@thistlm%
181+
\parbox[t]{\dimexpr\linewidth-\ALG@thistlm}{\hangindent=\trianglerightwidth \hangafter=1 \strut$\triangleright$ #1\strut}}
182+
\makeatother
183+
184+
% for footnote/marginnote
185+
% see https://tex.stackexchange.com/a/133265/23098
186+
\usepackage{tikz}
187+
\newcommand{\circled}[1]{%
188+
\tikz[baseline=(char.base)]
189+
\node [draw, circle, inner sep = 0.5pt, font = \tiny, minimum size = 8pt] (char) {#1};
190+
}
191+
\renewcommand\thefootnote{\protect\circled{\arabic{footnote}}}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /