-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.tex
164 lines (130 loc) · 5.67 KB
/
main.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
\documentclass[letterpaper,11pt]{article}
\usepackage{import}
\usepackage{geometry}
\usepackage{pslatex}
\usepackage{graphicx}
\usepackage{color}
\usepackage{tikz}
\usepackage{setspace}
\usepackage{amssymb}
\geometry{ margin = 1.0in }
\usepackage{fancyhdr}
%\setlength{\headheight}{15pt}
\pagestyle{fancy}
%\renewcommand{\chaptermark}[1]{ \markboth{#1}{} }
\renewcommand{\sectionmark}[1]{ \markright{#1} }
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[RE]{{ \nouppercase{\leftmark}} }
\fancyhead[LO]{{ \nouppercase{\thesection:~\rightmark}} }
\renewcommand{\thesection}{Lecture~\arabic{section}}
\fancypagestyle{titlestyle}
{
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
}
\fancypagestyle{tablestyle}
{
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[RE]{{ \nouppercase{\leftmark}} }
\fancyhead[LO]{{ \nouppercase{\rightmark}} }
}
\usepackage{titlesec}
\setlength\parindent{0em}
\setlength\parskip{6pt}
\titlespacing*{\section}{0pt}{2.4ex plus 0.2ex minus .1ex}{1.0ex plus .2ex minus .1ex}
\titlespacing*{\subsection}{0pt}{2.0ex plus 0.2ex minus .1ex}{0.6ex plus .2ex minus .1ex}
%\setlength{\fboxsep}{6pt}
\usepackage{amsthm}
\newtheoremstyle{mytheorem}
{\parskip} % Space above
{0em} % Space below
{} % Body font
{} % Indent amount
{\bfseries} % Theorem head font
{.} % Punctuation after theorem head
{.5em} % Space after theorem head
{} % Theorem head spec (can be left empty, meaning `normal')
\theoremstyle{mytheorem}
\newtheorem{definition}{Definition}
\newtheorem{property}{Property}
\newtheorem{claim}{Claim}
\newtheorem{fact}{Fact}
\newtheorem{corollary}{Corollary}
% for algorithms
\newcommand{\aaa}[1]{\hspace{0.65cm}\parbox[t]{15.3cm}{#1}}
\newcommand{\aab}[1]{\hspace{1.15cm}\parbox[t]{15.0cm}{#1}}
\newcommand{\aac}[1]{\hspace{1.65cm}\parbox[t]{15.0cm}{#1}}
\newcommand{\aad}[1]{\hspace{2.15cm}\parbox[t]{15.0cm}{#1}}
\newcommand{\aae}[1]{\hspace{2.65cm}\parbox[t]{15.0cm}{#1}}
\newcommand{\aaf}[1]{\hspace{3.15cm}\parbox[t]{15.0cm}{#1}}
\newcommand{\aaA}[2]{\hspace{0.5cm} {\tikz[overlay] \draw (0.1, -0.1) -- (0.1, #1 * -1.5em + 0.6em);} \parbox[t]{15.0cm}{#2}}
\newcommand{\aaB}[2]{\hspace{1.0cm} {\tikz[overlay] \draw (0.1, -0.1) -- (0.1, #1 * -1.5em + 0.6em);} \parbox[t]{15.0cm}{#2}}
\newcommand{\aaC}[2]{\hspace{1.5cm} {\tikz[overlay] \draw (0.1, -0.1) -- (0.1, #1 * -1.5em + 0.6em);} \parbox[t]{15.0cm}{#2}}
\newcommand{\aaD}[2]{\hspace{2.0cm} {\tikz[overlay] \draw (0.1, -0.1) -- (0.1, #1 * -1.5em + 0.6em);} \parbox[t]{15.0cm}{#2}}
\newcommand{\aaE}[2]{\hspace{2.5cm} {\tikz[overlay] \draw (0.1, -0.1) -- (0.1, #1 * -1.5em + 0.6em);} \parbox[t]{15.0cm}{#2}}
\newcommand{\xxx}{\par\vspace{0.1cm}}
\begin{document}
% title page
\thispagestyle{titlestyle}
\begin{center}
\vspace*{4cm} {\Huge \bf Lecture Notes for Algorithms } \vspace*{2cm}
{\Large Mingfu Shao}
{\Large The Pennsylvania State University}
{\Large \today}
\vspace*{8cm}
{\large This document is distributed under CC-BY-NC license.}
\end{center}
\clearpage \newpage
\makeatletter
\renewcommand{\l@section}{\@dottedtocline{1}{0em}{5em}}
\makeatother
\thispagestyle{tablestyle}
\tableofcontents \thispagestyle{tablestyle} \clearpage \newpage
\addcontentsline{toc}{section}{\textbf{Introduction}}
\import{introduction/}{content.tex} \clearpage\newpage
\import{asymptotic-notations/}{content.tex} \clearpage\newpage
\addcontentsline{toc}{section}{\textbf{Divide-and-Conquer}}
\import{merge-sort/}{content.tex} \clearpage\newpage
\import{counting-inversions/}{content.tex} \clearpage\newpage
\import{selection/}{content.tex} \clearpage\newpage
\import{closest-pairs/}{content.tex} \clearpage\newpage
\import{convex-hull/}{content.tex} \clearpage\newpage
\import{half-plane-intersection/}{content.tex} \clearpage\newpage
\addcontentsline{toc}{section}{\textbf{Connectivity of Graphs}}
\import{graphs/}{content.tex} \clearpage\newpage
\import{connectivity-undirected/}{content.tex} \clearpage\newpage
\import{dag-meta/}{content.tex} \clearpage\newpage
\import{connectivity-directed/}{content.tex} \clearpage\newpage
\import{2sat/}{content.tex} \clearpage\newpage
\addcontentsline{toc}{section}{\textbf{Shortest Path Problems}}
\import{priority-queue/}{content.tex} \clearpage\newpage
\import{bfs/}{content.tex} \clearpage\newpage
\import{dijkstra/}{content.tex} \clearpage\newpage
\import{bellman-ford/}{content.tex} \clearpage\newpage
\import{shortest-path-tree/}{content.tex} \clearpage\newpage
\import{tramp-steamer/}{content.tex} \clearpage\newpage
\addcontentsline{toc}{section}{\textbf{Dynamic Programming}}
\import{longest-increasing-subsequence/}{content.tex} \clearpage\newpage
\import{edit-distance/}{content.tex} \clearpage\newpage
\import{rna-secondary-structure/}{content.tex} \clearpage\newpage
\import{shortest-path-dp/}{content.tex} \clearpage\newpage
\import{knapsack/}{content.tex} \clearpage\newpage
\import{why-dp-table/}{content.tex} \clearpage\newpage
\addcontentsline{toc}{section}{\textbf{Greedy Algorithms}}
\import{minimum-spanning-tree/}{content.tex} \clearpage\newpage
\import{cut-property/}{content.tex} \clearpage\newpage
\import{disjoint-set/}{content.tex} \clearpage\newpage
\import{interval-scheduling/}{content.tex} \clearpage\newpage
\import{weighted-interval-scheduling/}{content.tex} \clearpage\newpage
%% \import{vertex-cover/}{content.tex} \clearpage\newpage
\addcontentsline{toc}{section}{\textbf{Network Flow}}
\import{max-flow/}{content.tex} \clearpage\newpage
\import{ford-fulkson/}{content.tex} \clearpage\newpage
\import{max-matching/}{content.tex} \clearpage\newpage
\import{project-selection/}{content.tex} \clearpage\newpage
\addcontentsline{toc}{section}{\textbf{Computational Complexity}}
\import{reduction/}{content.tex} \clearpage\newpage
\import{npcomplete/}{content.tex} \clearpage\newpage
\end{document}