Answered By : D.W. There’s not really a significant difference. Spooling uses buffering. Buffering can be used for other purposes, too. The second quote you include in your question (I/O overlap, etc.) looks to me like it’s not very helpful. The Read More …
Category: Uncategorized
Find maximum element in sorted arrays in logarithmic time
Answered By : Aryabhata If the elements need not be distinct, then you cannot have an $O(log n)$ time algorithm. Consider the sorted array $[0,0, dots, 1]$ which has been cyclic shifted $k$ (unknown) times and you need to find where Read More …
Is there a known maximum for how much a string of 0’s and 1’s can be compressed?
Answered By : D.W. Kolmogorov complexity is one approach for formalizing this mathematically. Unfortunately, computing the Kolmogorov complexity of a string is an uncomputable problem. See also: Approximating the Kolmogorov complexity. It’s possible to get better results if you analyze the Read More …
Randomized Selection
Answered By : Louis Suppose your array has $n$ elements. As you have noted, the median is always in the bigger part after the first partition. The bigger part has size at most $alpha n$ if the smaller part has size Read More …
Easy reduction from 3SAT to Hamiltonian path problem
Answered By : c c The number of vertices in the well-known reduction from 3SAT to directed Hamiltonian Path(dHAMPATH) can be easily reduced to $O(n+k)$, where $n$ is the number of variables and $k$ is the number of clauses, therefore the Read More …
Why and how is a quantum computer faster than a regular computer?
Answered By : Alexey Romanov A quantum computer by itself isn’t faster. Instead, it has a different model of computation. In this model, there are algorithms for certain (not all!) problems, which are asymptotically faster than the fastest possible (or fastest Read More …
How can I prove that a build max heap’s amortized cost is $O(n)$?
Answered By : A.Schulz I assume that the operation build just turns an array into a heap by repairing the heap-property for every subtree bottom-up (let the operation for a single repair step called heapify). It is not so hard to Read More …
Practical Applications of Radix Sort
Answered By : Wandering Logic Radix sorts are often, in practice, the fastest and most useful sorts on parallel machines. Zagha and Blelloch: Radix sort for vector multiprocessors. Supercomputing, 1991: 712-721. Blelloch, Leiserson, Maggs, Plaxton, Smith, and Zagha: A Comparison of Read More …
Why is a quantum computer not capable of solving more problems than a classical computer?
Answered By : David Richerby Because a quantum computer can be simulated using a classical computer: it’s essentially just linear algebra. Given a probability distribution for each of the qubits, you can keep track of how each quantum gate modifies those Read More …
Modifying Dijkstra’s algorithm for edge weights drawn from range $[1,…,K]$
Answered By : Neal Young If edge weights are integers in ${0,1,ldots,K}$, you can implement Dijkstra’s to run in $O(K|V|+|E|)$ time, following @rrenaud’s suggestion. Here is a more explicit explanation. At any time, the (finite) keys in the priority queue are Read More …