Amortised Analysis · بذر 1 · A۴، مناسب چاپ. پاسخ‌نامه در صفحه‌ای جدا برای بزرگ‌ترها چاپ می‌شود.
به انگلیسی

Cheap usually, rare splurge, fair average

رایانش · الگوریتم‌ها و ساختمان داده‌ها · سن ۱۹ تا ۲۱ سال
نام ______________________   تاریخ ____________
  1. When does a doubling array pay a big copy?

    • On every append
    • When items are read
    • Only when the array fills
  2. What does an amortised bound describe?

    • One lucky input
    • The average over any sequence
    • The cost of one line of code
  3. An amortised bound is an average-case claim about random inputs.

    دور یکی دایره کشیدن:   درست   نادرست

  4. A resize copies 8 items. What pays for it?

    • The stored credits on those slots
    • A faster processor
    • Deleting other arrays
  5. Each cheap append stores 2 credits. After 4 such appends, type the stored credits.

    پاسخ: ______________

  6. Why does a million appends cost a few million steps, not a million squared?

    • Copies thin out as the array grows
    • Appends skip writing entirely
    • Squares round down at scale
  7. With three coins per append, a hostile sequence can still break the constant average.

    دور یکی دایره کشیدن:   درست   نادرست

  8. A critic points at one copying append and calls the structure linear per append. What is the flaw?

    • Copying appends never occur
    • One costly call cannot price a whole run
    • Arrays forbid all analysis
LightMySky · lightmysky.comW1-mt_1zLrl5RKGr-s1

پاسخ‌نامه

برای بزرگ‌ترها. تا کردن این صفحه پیش از تحویل بقیه.

Cheap usually, rare splurge, fair average W1-mt_1zLrl5RKGr-s1

  1. Only when the array fills · Full arrays copy into a doubled home.
  2. The average over any sequence · It averages a run, whatever the sequence.
  3. نادرست · It is a worst-case promise over any sequence.
  4. The stored credits on those slots · Prepaid credits cover the copy run.
  5. 8 · Four appends times two credits makes eight.
  6. Copies thin out as the array grows · Doubling spaces the costly copies wider apart.
  7. نادرست · The promise holds for any sequence.
  8. One costly call cannot price a whole run · Amortised pricing spreads rare costs across the run.