Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a22583490a0b90ce

Jump to content

Talk:Accounting method (computer science)

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 3 months ago by Sergio.losilla in topic The article reads as a poorly written textbook

hi every body,

               Can any one explain the accounting method with a diagram .

Does it work for other than constant amortized time?

[edit]

It says in the article "is most naturally suited for proving a O(1) bound", but I do not really understand this sentence. Is it "naturally suited" (and only suited) for this? Or is proving O(1) what it is most suitable for, while it is applicable but less "suitable" for proving other running times?

If it does work for proving other amortised running times, e.g. log n, then it would be really nice with a link to a demonstration this use.

Velle (talk) 23:29, 7 January 2010 (UTC)Reply

dynamic array example

[edit]

"Inserting element m + 1 requires reallocation of the table. Creating the new table on line 3 is free (for now). The loop on line 4 requires m elementary insertions, for a cost of m. Including the insertion on the last line, the total cost for this operation is m + 1. After this operation, the pool therefore has 2m + 3 - (m + 1) = m + 2."

Explain that you add the 3 to 2m - (m+1) as payment for the last insertion. —Preceding unsigned comment added by 79.229.210.164 (talk) 11:38, 28 August 2010 (UTC)Reply

Best bound O(n2) ? No, it is O(2×n) !

[edit]

The text says at Accounting method (computer science)#Table expansion:

"Without amortized analysis, the best bound we can show for n insert operations is O(n2) this is due to the loop at line 4 that performs num(T) elementary insertions."

But I count unrolling "the loop at line 4":

EffectiveRepeatedNewTogether
1011
2113
421+17
841+1+1+115

So, if n=2k there are n=2k+1–1 = 2×n–1 insertions which is O(2×n), and not O(n2). Pls help me calculating! --Nomen4Omen (talk) 11:02, 11 December 2018 (UTC)Reply

"Accounting method" listed at Redirects for discussion

[edit]

An editor has identified a potential problem with the redirect Accounting method and has thus listed it for discussion. This discussion will occur at Wikipedia:Redirects for discussion/Log/2022 November 15#Accounting method until a consensus is reached, and readers of this page are welcome to contribute to the discussion. GeoffreyT2000 (talk) 02:56, 15 November 2022 (UTC)Reply

The article reads as a poorly written textbook

[edit]

First, the article fails to adequate to the MoS.

The tone should be encyclopedic and not instructional; the article feels mostly like reading a textbook, as illustrated by this excerpt:

"Does this new cost present a difficulty? Not really; it turns out we use the same method to show the amortized O(1) bounds. All we have to do is change the payment."

The "table insertion" example is very confusingly written, the way the "pool" is growing and shrinking is very confusing to follow. Another example is here:

"For analysis using the accounting method, we assign a payment of 3 to each table insertion. Although the reason for this is not clear now, it will become clear during the course of the analysis."

Although "payment of 3" reads like an assumption that is necessary for the reasoning, it is actually the conclusion.

Those are a few examples, but in general it is simply a confusing read. Sergio.losilla (talk) 20:22, 8 April 2026 (UTC)Reply