diff --git a/chapter04.tex b/chapter04.tex index bec5ceb..6c4bdb3 100644 --- a/chapter04.tex +++ b/chapter04.tex @@ -473,7 +473,7 @@ element that corresponds to $a$ or the previous element. \index{bitset} -A \texttt{bitset} is an array +A \key{bitset} is an array where each element is either 0 or 1. For example, the following code creates a bitset that contains 10 elements: @@ -528,7 +528,7 @@ cout << (a^b) << "\n"; // 1001101110 \index{deque} -A \texttt{deque} is a dynamic array +A \key{deque} is a dynamic array whose size can be changed at both ends of the array. Like a vector, a deque provides the functions \texttt{push\_back} and \texttt{pop\_back}, but @@ -556,7 +556,7 @@ elements is $O(1)$ on average at both ends. \index{stack} -A \texttt{stack} +A \key{stack} is a data structure that provides two $O(1)$ time operations: adding an element to the top, @@ -578,7 +578,7 @@ cout << s.top(); // 2 \index{queue} -A \texttt{queue} also +A \key{queue} also provides two $O(1)$ time operations: adding an element to the end of the queue, and removing the first element in the queue. @@ -601,7 +601,7 @@ cout << s.front(); // 2 \index{priority queue} \index{heap} -A \texttt{priority\_queue} +A \key{priority queue} maintains a set of elements. The supported operations are insertion and, depending on the type of the queue,