├── .gitignore ├── README.md ├── additional-resources └── pseudocode-template │ ├── macros.tex │ └── main.tex ├── homeworks ├── homework-0 │ ├── CSCI-470-Homework-Template-0 │ │ ├── insertion_sort.py │ │ ├── macros.tex │ │ ├── main.tex │ │ └── tests.py │ └── CSCI_470_Homework_0.pdf ├── homework-1 │ ├── CSCI-470-Homework-1-Solution-Template │ │ ├── macros.tex │ │ └── main.tex │ └── CSCI_470_Homework_1.pdf ├── homework-2 │ ├── CSCI-470-Homework-2-Solution-Template │ │ ├── macros.tex │ │ └── main.tex │ ├── CSCI_470_Homework_02.pdf │ └── README.md ├── homework-3 │ ├── CSCI-470-Homework-03-Template │ │ ├── macros.tex │ │ └── main.tex │ └── CSCI_470_Homework_03.pdf ├── homework-4 │ ├── CSCI-470-Homework-04-Template │ │ ├── macros.tex │ │ └── main.tex │ └── CSCI_470_Homework_04.pdf └── homework-5 │ ├── CSCI-470-Homework-05-Template │ ├── macros.tex │ └── main.tex │ └── CSCI_470_Homework_05.pdf ├── lecture-notes ├── Lec-01 │ ├── CSCI470_Lecture_Note_01_Aug_21.pdf │ └── CSCI_470_Lec_01_Slides.pdf ├── Lec-02 │ ├── CSCI470_Lecture_Notes_02_Aug_23 .pdf │ └── CSCI_470_Lec_02_Slides.pdf ├── Lec-03 │ ├── CSCI470_Lecture_Notes_03_Aug_28.pdf │ └── CSCI_470_Lec_03_Slides_Aug_28.pdf ├── Lec-04 │ ├── CSCI_470_Lec_04_Slides_Aug_30_Presented_In_Class.pdf │ └── CSCI_470_Lecture_Notes_04_Aug_30.pdf ├── Lec-05 │ ├── CSCI_470_Lec_05_Slides_Sep_06.pdf │ └── CSCI_470_Lecture_Notes_05_Sep_06.pdf ├── Lec-06 │ ├── CSCI_470_Lec_06_Slides_Sep_11.pdf │ └── CSCI_470_Lecture_Note_06_&_07.pdf ├── Lec-07 │ └── CSCI_470_Lec_07_Slides_Sep_13.pdf ├── Lec-08 │ └── CSCI_470_Lec_08_Slides_Sep_20.pdf ├── Lec-09 │ ├── CSCI_470_Lecture_Note_09.pdf │ └── CSCI_470_Lecture_Slides_Sep_27.pdf ├── Lec-10 │ ├── CSCI_470_Lecture_Note_10.pdf │ └── CSCI_470_Lecture_Slides_Oct_02.pdf ├── Lec-11 │ ├── CSCI_470_Lecture_Note_11.pdf │ ├── CSCI_470_Lecture_Slides_Oct_04.pdf │ └── CSCI_470_Lecture_Slides_Oct_11.pdf ├── Lec-12 │ ├── CSCI_470_Lecture_Note_12.pdf │ └── CSCI_470_Lecture_Slides_Oct_18.pdf ├── Lec-13 │ ├── CSCI_470_Lecture_Note_13.pdf │ └── CSCI_470_Lecture_Slides_Oct_23.pdf └── rest-of-slides │ ├── CSCI_470_Lecture_Slides_Nov_06.pdf │ ├── CSCI_470_Lecture_Slides_Nov_08.pdf │ ├── CSCI_470_Lecture_Slides_Nov_13.pdf │ ├── CSCI_470_Lecture_Slides_Nov_15.pdf │ ├── CSCI_470_Lecture_Slides_Nov_20.pdf │ ├── CSCI_470_Lecture_Slides_Nov_22.pdf │ └── CSCI_470_Lecture_Slides_Oct_25.pdf └── practice-exam ├── exam-1 ├── CSCI_470_Practice_Exam_Questions.pdf └── CSCI_470_Practice_Exam_Solutions.pdf ├── exam-2 ├── CSCI_470_Practice_Exam_II.pdf └── CSCI_470_Practice_Exam_II_Questions_Answers.pdf └── final-exam ├── CSCI_470_Practice_Final_Exam_Questions_Part_2.pdf ├── CSCI_470_Practice_Final_Exam_Questions_Part_I.pdf └── CSCI_470_Practice_Final_Exam_Questions_Solutions.pdf /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### CSCI 470 Fundamentals of Algorithms Fall 2023 2 | 3 | This repository will be temporarily up to share the lecture notes, homeworks, and lectures slides until I can post the course material on Canvas. 4 | 5 | 6 | -------------------------------------------------------------------------------- /additional-resources/pseudocode-template/macros.tex: -------------------------------------------------------------------------------- 1 | 2 | % This template is borrowed from OCW MIT 6.006 Spring 2020 course. 3 | 4 | \newcommand{\name}{} 5 | 6 | \usepackage{amssymb} 7 | \usepackage{amsmath} 8 | \usepackage{graphicx} 9 | \usepackage{latexsym} 10 | \usepackage{times,url} 11 | \usepackage{cprotect} 12 | \usepackage{listings} 13 | \usepackage{graphicx} 14 | \usepackage[table]{xcolor} 15 | \usepackage[letterpaper]{geometry} 16 | \usepackage{tikz-qtree} 17 | \usepackage{enumerate} 18 | \usepackage{hyperref} 19 | \usepackage{clrscode3e} 20 | % \usepackage{algorithm} 21 | % \usepackage{algpseudocode} 22 | 23 | \newcommand{\profs}{Instructor: Vijay Chaudhary} 24 | \newcommand{\subj}{CSCI 470} 25 | \newcommand{\ttt}[1]{{\tt\small #1}} 26 | 27 | \definecolor{dkgreen}{rgb}{0,0.6,0} 28 | \definecolor{dkblue}{rgb}{.2,.2,1} 29 | \definecolor{gray}{rgb}{0.5,0.5,0.5} 30 | \definecolor{mauve}{rgb}{0.58,0,0.82} 31 | 32 | \lstset{ 33 | language=Python, 34 | aboveskip=1pc, 35 | belowskip=1pc, 36 | basicstyle={\footnotesize\ttfamily}, 37 | numbers=left, 38 | showstringspaces=false, 39 | numberstyle={\tiny\color{gray}\ttfamily}, 40 | keywordstyle={\color{dkblue}\ttfamily}, 41 | commentstyle={\color{dkgreen}\ttfamily}, 42 | stringstyle={\color{mauve}\ttfamily}, 43 | } 44 | 45 | % \lstset{ 46 | % language=Python, 47 | % aboveskip=1pc, 48 | % belowskip=1pc, 49 | % basicstyle={\bf\color{white}\ttfamily}, 50 | % numbers=left, 51 | % showstringspaces=false, 52 | % numberstyle={\bf\small\color{lightgray}\ttfamily}, 53 | % keywordstyle={\bf\color{cyan}\ttfamily}, 54 | % commentstyle={\bf\color{green}\ttfamily}, 55 | % stringstyle={\bf\color{mauve}\ttfamily}, 56 | % } 57 | 58 | \tikzset{ 59 | % every node/.style={minimum width=2em,draw,circle}, 60 | % level 1/.style={sibling distance=2cm}, 61 | level distance=1cm, 62 | edge from parent/.style= 63 | {draw,edge from parent path={(\tikzparentnode) -- (\tikzchildnode)}}, 64 | } 65 | \usetikzlibrary{shapes} 66 | 67 | \newif\ifHideSolutions 68 | \newcommand{\solution}[1]{\color{dkgreen}\textbf{Solution: }#1\color{black}} 69 | \newcommand{\commonmistakes}[1]{{\color{dkblue}\textbf{Common Mistakes: }#1}} 70 | \newcommand{\rubric}[1]{\color{dkgreen}{\bf Rubric:} #1\color{black}} 71 | 72 | % \HideSolutionsfalse 73 | % \ifHideSolutions 74 | % \renewcommand{\solution}[1]{} 75 | % \renewcommand{\rubric}[1]{} 76 | % \fi 77 | 78 | \newlength{\toppush} 79 | \setlength{\toppush}{2\headheight} 80 | \addtolength{\toppush}{\headsep} 81 | 82 | \newcommand{\htitle}[2]{\noindent\vspace*{-\toppush}\newline\parbox{\textwidth} 83 | {\textit{CSCI 470 Fundamentals of Algorithms}\hfill\name\newline 84 | Howard University \hfill #2\newline 85 | \profs\hfill #1 \\[-3.5ex]\newline 86 | \mbox{}\hrulefill\mbox{}}\vspace*{1ex}\mbox{}\newline 87 | \begin{center}{\Large\bf #1}\end{center}} 88 | 89 | \newcommand{\handout}[2]{\thispagestyle{empty} 90 | \markboth{#1}{#1} 91 | \pagestyle{myheadings}\htitle{#1}{#2}} 92 | 93 | \newcommand{\lecture}[3]{\thispagestyle{empty} 94 | \markboth{Lecture #1: #2}{Lecture #1: #2} 95 | \pagestyle{myheadings}\htitle{Lecture #1: #2}{#3}} 96 | 97 | \newcommand{\htitlewithouttitle}[2]{\noindent\vspace*{-\toppush}\newline\parbox{6.5in} 98 | {\textit{Introduction to Algorithms}\hfill#2\newline 99 | Massachusetts Institute of Technology \hfill 6.006\newline 100 | \profs\hfill Handout #1\vspace*{-.5ex}\newline 101 | \mbox{}\hrulefill\mbox{}}\vspace*{1ex}\mbox{}\newline} 102 | 103 | \newcommand{\handoutwithouttitle}[2]{\thispagestyle{empty} 104 | \markboth{Handout \protect\ref{#1}}{Handout \protect\ref{#1}} 105 | \pagestyle{myheadings}\htitlewithouttitle{\protect\ref{#1}}{#2}} 106 | 107 | \newcommand{\exam}[2]{% parameters: exam name, date 108 | \thispagestyle{empty} 109 | \markboth{\hspace{1cm}\subj\ #1\hspace{1in}Name\hrulefill\ \ }% 110 | {\subj\ #1\hspace{1in}Name\hrulefill\ \ } 111 | \pagestyle{myheadings}\examtitle{#1}{#2} 112 | \renewcommand{\theproblem}{Problem \arabic{problemnum}} 113 | } 114 | \newcommand{\examsolutions}[3]{% parameters: handout, exam name, date 115 | \thispagestyle{empty} 116 | \markboth{Handout \protect\ref{#1}: #2}{Handout \protect\ref{#1}: #2} 117 | % \pagestyle{myheadings}\htitle{\protect\ref{#1}}{#2}{#3} 118 | \pagestyle{myheadings}\examsolutionstitle{\protect\ref{#1}} {#2}{#3} 119 | \renewcommand{\theproblem}{Problem \arabic{problemnum}} 120 | } 121 | \newcommand{\examsolutionstitle}[3]{\noindent\vspace*{-\toppush}\newline\parbox{6.5in} 122 | {\textit{Fundamentals of Algorithms}\hfill#3\newline 123 | Howard University \hfill 6.006\newline 124 | %Singapore-MIT Alliance \hfill SMA5503\newline 125 | \profs\hfill Handout #1\vspace*{-.5ex}\newline 126 | \mbox{}\hrulefill\mbox{}}\vspace*{1ex}\mbox{}\newline 127 | \begin{center}{\Large\bf #2}\end{center}} 128 | 129 | \newcommand{\takehomeexam}[2]{% parameters: exam name, date 130 | \thispagestyle{empty} 131 | \markboth{\subj\ #1\hfill}{\subj\ #1\hfill} 132 | \pagestyle{myheadings}\examtitle{#1}{#2} 133 | \renewcommand{\theproblem}{Problem \arabic{problemnum}} 134 | } 135 | 136 | \makeatletter 137 | \newcommand{\exambooklet}[2]{% parameters: exam name, date 138 | \thispagestyle{empty} 139 | \markboth{\subj\ #1}{\subj\ #1} 140 | \pagestyle{myheadings}\examtitle{#1}{#2} 141 | \renewcommand{\theproblem}{Problem \arabic{problemnum}} 142 | \renewcommand{\problem}{\newpage 143 | \item \let\@currentlabel=\theproblem 144 | \markboth{\subj\ #1, \theproblem}{\subj\ #1, \theproblem}} 145 | } 146 | \makeatother 147 | 148 | 149 | \newcommand{\examtitle}[2]{\noindent\vspace*{-\toppush}\newline\parbox{6.5in} 150 | {\textit{Introduction to Algorithms}\hfill#2\newline 151 | Massachusetts Institute of Technology \hfill 6.006 Spring 2020\newline 152 | %Singapore-MIT Alliance \hfill SMA5503\newline 153 | \profs\hfill #1\vspace*{-.5ex}\newline 154 | \mbox{}\hrulefill\mbox{}}\vspace*{1ex}\mbox{}\newline 155 | \begin{center}{\Large\bf #1}\end{center}} 156 | 157 | \newcommand{\grader}[1]{\hspace{1cm}\textsf{\textbf{#1}}\hspace{1cm}} 158 | 159 | \newcommand{\points}[1]{[#1 points]\ } 160 | \newcommand{\parts}[1] 161 | { 162 | \ifnum#1=1 163 | (1 part) 164 | \else 165 | (#1 parts) 166 | \fi 167 | \ 168 | } 169 | 170 | \newcommand{\bparts}{\begin{problemparts}} 171 | \newcommand{\eparts}{\end{problemparts}} 172 | \newcommand{\ppart}{\problempart} 173 | 174 | %\newcommand{\lg} {lg\ } 175 | 176 | \setlength{\oddsidemargin}{0pt} 177 | \setlength{\evensidemargin}{0pt} 178 | \setlength{\textwidth}{6.5in} 179 | \setlength{\topmargin}{0in} 180 | \setlength{\textheight}{8.5in} 181 | 182 | 183 | \newcommand{\Spawn}{{\bf spawn} } 184 | \newcommand{\Sync}{{\bf sync}} 185 | 186 | \renewcommand{\cases}[1]{\left\{ \begin{array}{ll}#1\end{array}\right.} 187 | \newcommand{\cif}[1]{\mbox{if $#1$}} 188 | \newcommand{\cwhen}[1]{\mbox{when $#1$}} 189 | 190 | \newcounter{problemnum} 191 | \newcommand{\theproblem}{Problem \theproblemsetnum-\arabic{problemnum}} 192 | \newenvironment{problems}{ 193 | \begin{list}{{\bf \theproblem. \hspace*{0.5em}}} 194 | {\setlength{\leftmargin}{0em} 195 | \setlength{\rightmargin}{0em} 196 | \setlength{\labelwidth}{0em} 197 | \setlength{\labelsep}{0em} 198 | \usecounter{problemnum}}}{\end{list}} 199 | \makeatletter 200 | \newcommand{\problem}[1][{}]{\item \let\@currentlabel=\theproblem \textbf{#1}} 201 | \makeatother 202 | 203 | \newcounter{problempartnum}[problemnum] 204 | \newenvironment{problemparts}{ 205 | \begin{list}{{\bf (\alph{problempartnum})}} 206 | {\setlength{\leftmargin}{2.5em} 207 | \setlength{\rightmargin}{2.5em} 208 | \setlength{\labelsep}{0.5em}}}{\end{list}} 209 | \newcommand{\problempart}{\addtocounter{problempartnum}{1}\item} 210 | 211 | \newenvironment{truefalseproblemparts}{ 212 | \begin{list}{{\bf (\alph{problempartnum})\ \ \ T\ \ F\hfil}} 213 | {\setlength{\leftmargin}{4.5em} 214 | \setlength{\rightmargin}{2.5em} 215 | \setlength{\labelsep}{0.5em} 216 | \setlength{\labelwidth}{4.5em}}}{\end{list}} 217 | 218 | \newcounter{exercisenum} 219 | \newcommand{\theexercise}{Exercise \theproblemsetnum-\arabic{exercisenum}} 220 | \newenvironment{exercises}{ 221 | \begin{list}{{\bf \theexercise. \hspace*{0.5em}}} 222 | {\setlength{\leftmargin}{0em} 223 | \setlength{\rightmargin}{0em} 224 | \setlength{\labelwidth}{0em} 225 | \setlength{\labelsep}{0em} 226 | \usecounter{exercisenum}}}{\end{list}} 227 | \makeatletter 228 | \newcommand{\exercise}{\item \let\@currentlabel=\theexercise} 229 | \makeatother 230 | 231 | \newcounter{exercisepartnum}[exercisenum] 232 | %\newcommand{\problem}[1]{\medskip\mbox{}\newline\noindent{\bf Problem #1.}\hspace*{1em}} 233 | %\newcommand{\exercise}[1]{\medskip\mbox{}\newline\noindent{\bf Exercise #1.}\hspace*{1em}} 234 | 235 | \newenvironment{exerciseparts}{ 236 | \begin{list}{{\bf (\alph{exercisepartnum})}} 237 | {\setlength{\leftmargin}{2.5em} 238 | \setlength{\rightmargin}{2.5em} 239 | \setlength{\labelsep}{0.5em}}}{\end{list}} 240 | \newcommand{\exercisepart}{\addtocounter{exercisepartnum}{1}\item} 241 | 242 | 243 | % Macros to make captions print with small type and 'Figure xx' in bold. 244 | \makeatletter 245 | \def\fnum@figure{{\bf Figure \thefigure}} 246 | \def\fnum@table{{\bf Table \thetable}} 247 | \let\@mycaption\caption 248 | %\long\def\@mycaption#1[#2]#3{\addcontentsline{\csname 249 | % ext@#1\endcsname}{#1}{\protect\numberline{\csname 250 | % the#1\endcsname}{\ignorespaces #2}}\par 251 | % \begingroup 252 | % \@parboxrestore 253 | % \small 254 | % \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par 255 | % \endgroup} 256 | %\def\mycaption{\refstepcounter\@captype \@dblarg{\@mycaption\@captype}} 257 | %\makeatother 258 | \let\mycaption\caption 259 | %\newcommand{\figcaption}[1]{\mycaption[]{#1}} 260 | 261 | \newcounter{totalcaptions} 262 | \newcounter{totalart} 263 | 264 | \newcommand{\figcaption}[1]{\addtocounter{totalcaptions}{1}\caption[]{#1}} 265 | 266 | % \psfigures determines what to do for figures: 267 | % 0 means just leave vertical space 268 | % 1 means put a vertical rule and the figure name 269 | % 2 means insert the PostScript version of the figure 270 | % 3 means put the figure name flush left or right 271 | \newcommand{\psfigures}{0} 272 | \newcommand{\spacefigures}{\renewcommand{\psfigures}{0}} 273 | \newcommand{\rulefigures}{\renewcommand{\psfigures}{1}} 274 | \newcommand{\macfigures}{\renewcommand{\psfigures}{2}} 275 | \newcommand{\namefigures}{\renewcommand{\psfigures}{3}} 276 | 277 | \newcommand{\figpart}[1]{{\bf (#1)}\nolinebreak[2]\relax} 278 | \newcommand{\figparts}[2]{{\bf (#1)--(#2)}\nolinebreak[2]\relax} 279 | 280 | 281 | \macfigures % STATE 282 | 283 | % When calling \figspace, make sure to leave a blank line afterward!! 284 | % \widefigspace is for figures that are more than 28pc wide. 285 | \newlength{\halffigspace} \newlength{\wholefigspace} 286 | \newlength{\figruleheight} \newlength{\figgap} 287 | \newcommand{\setfiglengths}{\ifnum\psfigures=1\setlength{\figruleheight}{\hruleheight}\setlength{\figgap}{1em}\else\setlength{\figruleheight}{0pt}\setlength{\figgap}{0em}\fi} 288 | \newcommand{\figspace}[2]{\ifnum\psfigures=0\leavefigspace{#1}\else% 289 | \setfiglengths% 290 | \setlength{\wholefigspace}{#1}\setlength{\halffigspace}{.5\wholefigspace}% 291 | \rule[-\halffigspace]{\figruleheight}{\wholefigspace}\hspace{\figgap}#2\fi} 292 | \newlength{\widefigspacewidth} 293 | % Make \widefigspace put the figure flush right on the text page. 294 | \newcommand{\widefigspace}[2]{ 295 | \ifnum\psfigures=0\leavefigspace{#1}\else% 296 | \setfiglengths% 297 | \setlength{\widefigspacewidth}{28pc}% 298 | \addtolength{\widefigspacewidth}{-\figruleheight}% 299 | \setlength{\wholefigspace}{#1}\setlength{\halffigspace}{.5\wholefigspace}% 300 | \makebox[\widefigspacewidth][r]{#2\hspace{\figgap}}\rule[-\halffigspace]{\figruleheight}{\wholefigspace}\fi} 301 | \newcommand{\leavefigspace}[1]{\setlength{\wholefigspace}{#1}\setlength{\halffigspace}{.5\wholefigspace}\rule[-\halffigspace]{0em}{\wholefigspace}} 302 | 303 | % Commands for including figures with macpsfig. 304 | % To use these commands, documentstyle ``macpsfig'' must be specified. 305 | \newlength{\macfigfill} 306 | \makeatother 307 | \newlength{\bbx} 308 | \newlength{\bby} 309 | \newcommand{\macfigure}[5]{\addtocounter{totalart}{1} 310 | \ifnum\psfigures=2% 311 | \setlength{\bbx}{#2}\addtolength{\bbx}{#4}% 312 | \setlength{\bby}{#3}\addtolength{\bby}{#5}% 313 | \begin{flushleft} 314 | \ifdim#4>28pc\setlength{\macfigfill}{#4}\addtolength{\macfigfill}{-28pc}\hspace*{-\macfigfill}\fi% 315 | \mbox{\psfig{figure=./#1.ps,% 316 | bbllx=#2,bblly=#3,bburx=\bbx,bbury=\bby}} 317 | \end{flushleft}% 318 | \else\ifdim#4>28pc\widefigspace{#5}{#1}\else\figspace{#5}{#1}\fi\fi} 319 | \makeatletter 320 | 321 | \newlength{\savearraycolsep} 322 | \newcommand{\narrowarray}[1]{\setlength{\savearraycolsep}{\arraycolsep}\setlength{\arraycolsep}{#1\arraycolsep}} 323 | \newcommand{\normalarray}{\setlength{\arraycolsep}{\savearraycolsep}} 324 | 325 | \newcommand{\hint}{{\bf Hint:\ }} 326 | 327 | % Macros from /th/u/clr/mac.tex 328 | 329 | \newcommand{\set}[1]{\left\{ #1 \right\}} 330 | \newcommand{\abs}[1]{\left| #1\right|} 331 | \newcommand{\card}[1]{\left| #1\right|} 332 | \newcommand{\floor}[1]{\left\lfloor #1 \right\rfloor} 333 | \newcommand{\ceil}[1]{\left\lceil #1 \right\rceil} 334 | \newcommand{\ang}[1]{\ifmmode{\left\langle #1 \right\rangle} 335 | \else{$\left\langle${#1}$\right\rangle$}\fi} 336 | % the \if allows use outside mathmode, 337 | % but will swallow following space there! 338 | \newcommand{\paren}[1]{\left( #1 \right)} 339 | \newcommand{\bracket}[1]{\left[ #1 \right]} 340 | \newcommand{\prob}[1]{\Pr\left\{ #1 \right\}} 341 | \newcommand{\Var}{\mathop{\rm Var}\nolimits} 342 | \newcommand{\expect}[1]{{\rm E}\left[ #1 \right]} 343 | \newcommand{\expectsq}[1]{{\rm E}^2\left[ #1 \right]} 344 | \newcommand{\variance}[1]{{\rm Var}\left[ #1 \right]} 345 | \renewcommand{\choose}[2]{{{#1}\atopwithdelims(){#2}}} 346 | \def\pmod#1{\allowbreak\mkern12mu({\rm mod}\,\,#1)} 347 | \newcommand{\matx}[2]{\left(\begin{array}{*{#1}{c}}#2\end{array}\right)} 348 | \newcommand{\Adj}{\mathop{\rm Adj}\nolimits} 349 | 350 | \newtheorem{theorem}{Theorem} 351 | \newtheorem{lemma}[theorem]{Lemma} 352 | \newtheorem{corollary}[theorem]{Corollary} 353 | \newtheorem{xample}{Example} 354 | \newtheorem{definition}{Definition} 355 | \newenvironment{example}{\begin{xample}\rm}{\end{xample}} 356 | \newcommand{\proof}{\noindent{\em Proof.}\hspace{1em}} 357 | \def\squarebox#1{\hbox to #1{\hfill\vbox to #1{\vfill}}} 358 | \newcommand{\qedbox}{\vbox{\hrule\hbox{\vrule\squarebox{.667em}\vrule}\hrule}} 359 | \newcommand{\qed}{\nopagebreak\mbox{}\hfill\qedbox\smallskip} 360 | \newcommand{\eqnref}[1]{(\protect\ref{#1})} 361 | 362 | %%\newcommand{\twodots}{\mathinner{\ldotp\ldotp}} 363 | \newcommand{\transpose}{^{\mbox{\scriptsize \sf T}}} 364 | \newcommand{\amortized}[1]{\widehat{#1}} 365 | 366 | \newcommand{\punt}[1]{} 367 | 368 | %%% command for putting definitions into boldface 369 | % New style for defined terms, as of 2/23/88, redefined by THC. 370 | \newcommand{\defn}[1]{{\boldmath\textit{\textbf{#1}}}} 371 | \newcommand{\defi}[1]{{\textit{\textbf{#1\/}}}} 372 | 373 | \newcommand{\red}{\leq_{\rm P}} 374 | \newcommand{\lang}[1]{% 375 | \ifmmode\mathord{\mathcode`-="702D\rm#1\mathcode`\-="2200}\else{\rm#1}\fi} 376 | 377 | %\newcommand{\ckt}[1]{\ifmmode\mathord{\mathcode`-="702D\sc #1\mathcode`\-="2200}\else$\mathord{\mathcode`-="702D\sc #1\mathcode`\-="2200}$\fi} 378 | \newcommand{\ckt}[1]{\ifmmode \sc #1\else$\sc #1$\fi} 379 | 380 | %% Margin notes - use \notesfalse to turn off notes. 381 | \setlength{\marginparwidth}{0.6in} 382 | \reversemarginpar 383 | \newif\ifnotes 384 | \notestrue 385 | \newcommand{\longnote}[1]{ 386 | \ifnotes 387 | {\medskip\noindent Note: \marginpar[\hfill$\Longrightarrow$] 388 | {$\Longleftarrow$}{#1}\medskip} 389 | \fi} 390 | \newcommand{\note}[1]{ 391 | \ifnotes 392 | {\marginpar{\tiny \raggedright{#1}}} 393 | \fi} 394 | 395 | 396 | \newcommand{\reals}{\mathbbm{R}} 397 | \newcommand{\integers}{\mathbbm{Z}} 398 | \newcommand{\naturals}{\mathbbm{N}} 399 | \newcommand{\rationals}{\mathbbm{Q}} 400 | \newcommand{\complex}{\mathbbm{C}} 401 | 402 | \newcommand{\oldreals}{{\bf R}} 403 | \newcommand{\oldintegers}{{\bf Z}} 404 | \newcommand{\oldnaturals}{{\bf N}} 405 | \newcommand{\oldrationals}{{\bf Q}} 406 | \newcommand{\oldcomplex}{{\bf C}} 407 | 408 | \newcommand{\w}{\omega} %% for fft chapter 409 | 410 | \newenvironment{closeitemize}{\begin{list} 411 | {$\bullet$} 412 | {\setlength{\itemsep}{-0.2\baselineskip} 413 | \setlength{\topsep}{0.2\baselineskip} 414 | \setlength{\parskip}{0pt}}} 415 | {\end{list}} 416 | 417 | % These are necessary within a {problems} environment in order to restore 418 | % the default separation between bullets and items. 419 | \newenvironment{normalitemize}{\setlength{\labelsep}{0.5em}\begin{itemize}} 420 | {\end{itemize}} 421 | \newenvironment{normalenumerate}{\setlength{\labelsep}{0.5em}\begin{enumerate}} 422 | {\end{enumerate}} 423 | 424 | %\def\eqref#1{Equation~(\ref{eq:#1})} 425 | %\newcommand{\eqref}[1]{Equation (\ref{eq:#1})} 426 | \newcommand{\eqreftwo}[2]{Equations (\ref{eq:#1}) and~(\ref{eq:#2})} 427 | \newcommand{\ineqref}[1]{Inequality~(\ref{ineq:#1})} 428 | \newcommand{\ineqreftwo}[2]{Inequalities (\ref{ineq:#1}) and~(\ref{ineq:#2})} 429 | 430 | \newcommand{\figref}[1]{Figure~\ref{fig:#1}} 431 | \newcommand{\figreftwo}[2]{Figures \ref{fig:#1} and~\ref{fig:#2}} 432 | 433 | \newcommand{\liref}[1]{line~\ref{li:#1}} 434 | \newcommand{\Liref}[1]{Line~\ref{li:#1}} 435 | \newcommand{\lirefs}[2]{lines \ref{li:#1}--\ref{li:#2}} 436 | \newcommand{\Lirefs}[2]{Lines \ref{li:#1}--\ref{li:#2}} 437 | \newcommand{\lireftwo}[2]{lines \ref{li:#1} and~\ref{li:#2}} 438 | \newcommand{\lirefthree}[3]{lines \ref{li:#1}, \ref{li:#2}, and~\ref{li:#3}} 439 | 440 | \newcommand{\lemlabel}[1]{\label{lem:#1}} 441 | \newcommand{\lemref}[1]{Lemma~\ref{lem:#1}} 442 | 443 | \newcommand{\exref}[1]{Exercise~\ref{ex:#1}} 444 | 445 | \newcommand{\handref}[1]{Handout~\ref{#1}} 446 | 447 | \newcommand{\defref}[1]{Definition~\ref{def:#1}} 448 | 449 | % (1997.8.16: Victor Luchangco) 450 | % Modified \hlabel to only get date and to use handouts counter for number. 451 | % New \handout and \handoutwithouttitle commands in newmac.tex use this. 452 | % The date is referenced by