Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor typos #75

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions latex/arrays.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}%
Expand Down
4 changes: 2 additions & 2 deletions latex/intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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#
Expand Down Expand Up @@ -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 .
\]
Expand Down
6 changes: 3 additions & 3 deletions latex/linkedlists.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down