pages={309--315},
year={1978}
}
+
+@article{ hoare:qsort,
+ title={{Quicksort}},
+ author={Hoare, Charles Anthony Richard},
+ journal={The Computer Journal},
+ volume={5},
+ number={1},
+ pages={10--16},
+ year={1962},
+ publisher={British Computer Society}
+}
+
+@article{ blum:selection,
+ title={{Time bounds for selection}},
+ author={Blum, M. and Floyd, R.W. and Pratt, V. and Rivest, R.L. and Tarjan, R.E.},
+ journal={Journal of Computer and System Sciences},
+ volume={7},
+ number={4},
+ pages={448--461},
+ year={1973}
+}
+
+@article{ hoare:qselect,
+ author = {Hoare, Charles Anthony Richard},
+ title = {Algorithm 65: find},
+ journal = {Communications of the ACM},
+ volume = {4},
+ number = {7},
+ year = {1961},
+ issn = {0001-0782},
+ pages = {321--322},
+ doi = {http://doi.acm.org/10.1145/366622.366647},
+ publisher = {ACM},
+ address = {New York, NY, USA},
+}
(optionally signalling that the value has been corrupted).
\endlist
+\examplen{Linear-time selection}
+We can use soft heaps to select the median (or generally the $k$-th smallest element)
+of a~sequence. We insert all $n$~elements to a~soft heap with error rate $\varepsilon=1/3$.
+Then we delete the minimum about $n/3$ times and we remember the current (possibly corrupted)
+value~$x$ of the last element deleted. This~$x$ is greater or equal than the current
+values of the previously deleted elements and thus also than their correct values.
+On the other hand, the current values of the $2n/3$ elements remaining in the heap
+are greater than~$x$ and at most $n/3$ of them are corrupted. Therefore at least $n/3$
+elements are greater than~$x$ and at least $n/3$ ones are smaller. Depending on the value
+of~$k$, we can always throw away one of these parts and recurse on the rest (similarly to
+the Hoare's Quickselect algorithm \cite{hoare:qselect}). The total time complexity will
+be $\O(n+(2/3)\cdot n+(2/3)^2\cdot n+\ldots) = \O(n)$. We have obtained a~nice alternative to the standard
+linear-time selection algorithm by Blum \cite{blum:selection}. The same trick can be used
+to select a~good pivot in Quicksort \cite{hoare:qsort}, leading to time complexity $\O(n\log n)$
+in the worst case.
+
\defnn{Soft queues}
The soft heap is built from \df{soft queues} (we will omit the adjective soft
in the rest of this section). Each queue has a~shape of a~binary tree.\foot{%