From b828cfadcae13fd151fcff27a8bec38bba5b81f7 Mon Sep 17 00:00:00 2001 From: "Luis F. Uceta" Date: Fri, 1 Mar 2019 18:56:51 -0500 Subject: [PATCH 1/2] Add missing colon and fix exponentiation formula --- latex/intro.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/latex/intro.tex b/latex/intro.tex index 238af3bb..6b7da5fc 100644 --- a/latex/intro.tex +++ b/latex/intro.tex @@ -272,7 +272,7 @@ \subsection{The #List# Interface: Linear Sequences} $#x#_{#i#},\ldots,#x#_{#n#-1}$; \\ Set $#x#_{j+1}=#x#_j$, for all $j\in\{#n#-1,\ldots,#i#\}$, increment #n#, and set $#x#_i=#x#$ - \item #remove(i)# remove the value $#x#_{#i#}$, displacing + \item #remove(i)#: remove the value $#x#_{#i#}$, displacing $#x#_{#i+1#},\ldots,#x#_{#n#-1}$; \\ Set $#x#_{j}=#x#_{j+1}$, for all $j\in\{#i#,\ldots,#n#-2\}$ and decrement #n# @@ -409,7 +409,7 @@ \subsection{Exponentials and Logarithms} \index{exponential}% The expression $b^x$ denotes the number $b$ raised to the power of $x$. If $x$ is a positive integer, then this is just the value of $b$ -multiplied by itself $x-1$ times: +multiplied by itself $x$ times: \[ b^x = \underbrace{b\times b\times \cdots \times b}_{x} \enspace . \] From 7631179bcdf61d27e6f2d4c8bf80a6006ebff953 Mon Sep 17 00:00:00 2001 From: "Luis F. Uceta" Date: Fri, 1 Mar 2019 19:00:38 -0500 Subject: [PATCH 2/2] Fix minor typos --- latex/arrays.tex | 6 +++--- latex/linkedlists.tex | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/latex/arrays.tex b/latex/arrays.tex index 21f30a41..3c875b81 100644 --- a/latex/arrays.tex +++ b/latex/arrays.tex @@ -73,7 +73,7 @@ \section{#ArrayStack#: Fast Stack Operations Using an Array} \seclabel{arraystack} \index{ArrayStack@#ArrayStack#}% -An #ArrayStack# implements the list interface using an array #a#, called +An #ArrayStack# implements the #List# interface using an array #a#, called the \emph{backing array}. The list element with index #i# is stored in #a[i]#. At most times, #a# is larger than strictly necessary, so an integer #n# is used to keep track of the number of elements @@ -305,7 +305,7 @@ \section{#ArrayQueue#: An Array-Based Queue} some integer $k$. Less formally, the value $r$ is the remainder we get when we divide $a$ by $m$. \pcodeonly{In many programming languages, including C, C++, and Java, -the mod operate is represented using the \% symbol.} +the mod operator is represented using the \% symbol.} \notpcode{In many programming languages, including \javaonly{Java}\cpponly{C++}, the $\bmod$ operator is represented using the #%# symbol.\footnote{This is sometimes referred to as the @@ -593,7 +593,7 @@ \subsection{Balancing} As in the proof of \lemref{arraystack-amortized}, this is sufficient to prove that the total time spent by #balance()# is $O(m)$. - We will perform our analysis using a technique knows as the + We will perform our analysis using a technique known as the \emph{potential method}. \index{potential}% \index{potential method}% diff --git a/latex/linkedlists.tex b/latex/linkedlists.tex index c32b148a..366df2f9 100644 --- a/latex/linkedlists.tex +++ b/latex/linkedlists.tex @@ -692,13 +692,13 @@ \section{Discussion and Exercises} interface.} \begin{enumerate} \item Write a #DLList# method called #takeFirst(l2)#. - This method takes the first node from #l2# and appends it to the the + This method takes the first node from #l2# and appends it to the receiving list. This is equivalent to #add(size(),l2.remove(0))#, except that it should not create a new node. \item Write a #DLList# static method, #merge(l1,l2)#, that takes two sorted lists #l1# and #l2#, merges them, and returns a new sorted list containing the result. This causes #l1# and #l2# to be emptied - in the proces. For example, if #l1# contains $a,c,d$ and #l2# contains + in the process. For example, if #l1# contains $a,c,d$ and #l2# contains $b,e,f$, then this method returns a new list containing $a,b,c,d,e,f$. \item Write a #DLList# method #sort()# that sorts the elements contained in the list using the merge sort algorithm. @@ -742,7 +742,7 @@ \section{Discussion and Exercises} \index{MinDeque@#MinDeque#}% Design and implement a #MinDeque# data structure that can store comparable elements and supports all the deque operations #addFirst(x)#, - #addLast(x)# #removeFirst()#, #removeLast()# and #size()#, and the + #addLast(x)#, #removeFirst()#, #removeLast()# and #size()#, and the #min()# operation, which returns the minimum value currently stored in the data structure. All operations should run in constant amortized time.