Answered By : Juho First, it is easy to see that the problem is in $text{NP}$. The longest path is a Hamiltonian one since it visits all vertices. Indeed, there is a straightforward reduction from $text{HAM-PATH}$ to it. For details and Read More …
Author: ignougroup
are NP Complete languages closed under any regular operations?
Answered By : David Richerby For all of the examples in this answer, I’m taking the alphabet to be ${0,1}$. Note that the languages $emptyset$ and ${0,1}^*$ are definitely not NP-complete. The class of NP-complete languages is not closed under intersection. Read More …
Is the set of Turing machines which stop in at most 50 steps on all inputs, decideable?
Answered By : Niel de Beaudrap Let’s consider the more general problem of machines which stop after at most $N$ steps, for some $N geqslant 1$. (The following is a substantial simplifcation of a previous version of this answer, but is Read More …
What is difference between Buffering and Spooling with respect to Operating System
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 …
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 …
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 …