# Search Results

Results tagged with Search options answers only user 683
22 results

A method in analysis of algorithms that considers the overall cost of a sequence of operations.

Let's review the potential function method. Suppose that the $i$th operation costs $c_i$ and the value of the potential function at time $i$ is $\Phi_i \geq 0$, and that $\Phi_0 = 0$ (the potential at …
answered Sep 3 '15 by Yuval Filmus
What they mean is exactly that: the invariant maintained by the data structure is that each of the arrays $A_0,\ldots,A_{k-1}$ is sorted. Nothing is maintained regarding the relative order of elements …
answered Feb 27 '16 by Yuval Filmus
No, if all we know about an operation is that it takes $O(f(n))$ times, then its amortized time is also $O(f(n))$. Sometimes, however, it is the case that while the worst-case running time is $O(f(n)) … answered Dec 17 '14 by Yuval Filmus In the potential method, operation$O$, which has real cost (say time complexity)$p(O)$is charged$c(O)$. The potential at any given point is $$\sum_{t=1}^T (c(O_t) - p(O_t)),$$ where$O_1,\ldots,O_ …
answered Nov 25 '15 by Yuval Filmus
A reasonable potential function here would be $C\ell$ or $C(k-\ell)$, where $\ell$ is the number of elements on the stack. However, I don't think that the amortized cost can be bounded. Consider $k$ …
answered Mar 28 '17 by Yuval Filmus
The potential function is a fictitious quantity which is used to bound the cost of operations in a data structure. Suppose that our data structure supports only one operation, whose worst-case cost is …
answered Sep 5 '16 by Yuval Filmus
As is unfortunately sometimes the case, Wikipedia is doing a terrible job of explaining what amortized analysis actually is. The idea of amortized analysis is that while operations may have a bad wor …
answered Dec 13 '16 by Yuval Filmus
You should be slightly more careful in your argument. Let the actual numbers you are adding be $x_1,\ldots,x_n > 0$, where $\ell_i = \lfloor \log_2 x_i \rfloor + 1$. The complexity of adding two numbe …
answered Mar 26 '14 by Yuval Filmus
For a number $m$, let $\alpha(m) = \max \{ k : k! | m \}$. This sequence starts at $\infty,1,2,1,2,1,3,\ldots$. I claim that in iteration $t$ of the algorithm (where $1 \leq t \leq n!-1$), we have $n- … answered Sep 25 '14 by Yuval Filmus If every$k$th operation takes$O(\log n)$time, then the best bound you can get on the amortized complexity is$O(1 + \frac{\log n}{k})$. This follows from the definition of amortized complexity. answered Apr 14 by Yuval Filmus We can divide the running time into several parts: Pushes. Pops. The first OP performed at every round. Subsequent OPs performed at every round. Note that every OP costs$O(\log n)$, that there ar … answered Jun 14 '16 by Yuval Filmus The answer hinges on the definition of amortized cost. Since you haven't given such a definition, let me assume that you are using the common definition. Consider a data structure supporting operatio … answered Mar 23 by Yuval Filmus Hint: Think of a value$n$such that the transition from$n$to$n+1$and back is very costly. answered Mar 10 '14 by Yuval Filmus What am I doing wrong here? You're using the wrong potential function. Keep looking. If you want to know the solution, the Wikipedia page on the potential method contains the answer. answered Dec 5 '14 by Yuval Filmus Here is a solution using direct calculation (I never liked all the fancy methods). Consider the cost of the first$n$inserts, and suppose that$2^k \leq n < 2^{k+1}$. Thus only the arrays$A_0,\ldots …
answered Nov 29 '16 by Yuval Filmus

15 30 50 per page