Small fixes
This commit is contained in:
parent
ab44c75fb9
commit
5587c3b515
|
@ -469,7 +469,7 @@ element that corresponds to $a$ or the previous element.
|
||||||
|
|
||||||
\section{Other structures}
|
\section{Other structures}
|
||||||
|
|
||||||
\subsubsection{Bitsets}
|
\subsubsection{Bitset}
|
||||||
|
|
||||||
\index{bitset}
|
\index{bitset}
|
||||||
|
|
||||||
|
@ -524,7 +524,7 @@ cout << (a|b) << "\n"; // 1011111110
|
||||||
cout << (a^b) << "\n"; // 1001101110
|
cout << (a^b) << "\n"; // 1001101110
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
\subsubsection{Deques}
|
\subsubsection{Deque}
|
||||||
|
|
||||||
\index{deque}
|
\index{deque}
|
||||||
|
|
||||||
|
@ -552,7 +552,7 @@ For this reason, a deque is slower than a vector.
|
||||||
Still, the time complexity of adding and removing
|
Still, the time complexity of adding and removing
|
||||||
elements is $O(1)$ on average at both ends.
|
elements is $O(1)$ on average at both ends.
|
||||||
|
|
||||||
\subsubsection{Stacks}
|
\subsubsection{Stack}
|
||||||
|
|
||||||
\index{stack}
|
\index{stack}
|
||||||
|
|
||||||
|
@ -574,7 +574,7 @@ cout << s.top(); // 5
|
||||||
s.pop();
|
s.pop();
|
||||||
cout << s.top(); // 2
|
cout << s.top(); // 2
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
\subsubsection{Queues}
|
\subsubsection{Queue}
|
||||||
|
|
||||||
\index{queue}
|
\index{queue}
|
||||||
|
|
||||||
|
@ -596,7 +596,7 @@ s.pop();
|
||||||
cout << s.front(); // 2
|
cout << s.front(); // 2
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
\subsubsection{Priority queues}
|
\subsubsection{Priority queue}
|
||||||
|
|
||||||
\index{priority queue}
|
\index{priority queue}
|
||||||
\index{heap}
|
\index{heap}
|
||||||
|
@ -641,10 +641,10 @@ q.pop();
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
\end{samepage}
|
\end{samepage}
|
||||||
|
|
||||||
Using the following declaration,
|
The following declaration
|
||||||
we can create a priority queue
|
creates a priority queue
|
||||||
that allows us to find and remove
|
that supports finding and removing
|
||||||
the minimum element:
|
minimum elements:
|
||||||
|
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
priority_queue<int,vector<int>,greater<int>> q;
|
priority_queue<int,vector<int>,greater<int>> q;
|
||||||
|
|
Loading…
Reference in New Issue