Skip to main content
CS Teaching Tips

Main navigation

  • Browse All Tips
  • Tags
  • 3D
  • About
  • Rate Tips
  • Tip Sheets

Use a visual proof to demonstrate that the better strategy for resizing arrays is doubling the size to make it easier for students to understand.

  • This proof uses amortised analysis to show that doubling the size of the array is more efficient than increasing the size of the array by a constant amount.
    • To see the visual proof, check out Don Blaheta's paper, "A Visual Proof of Amortised-linear Resizable Arrays".
  • Note from the CS Teaching Tips Team: for more information about amortised analysis, visit the Amortised Analysis Wikipedia page.

More about this tip

Tags

  • CS 2
  • Data Structures
External Source
“A Visual Proof of Amortised-linear Resizable Arrays” by Don Blaheta
Other Tips By
Other Tips By Don Blaheta

Similar tips

Foreshadow arrays right after teaching for loops by showing students how to create a 1x6 grid using the rectangle object in the Java objectdraw library because visualizations built off of recently introduced material provide a useful transition.
Get students paying attention to types in Python; although type declarations aren’t explicitly required in Python, they still exist and are crucial to understanding how Python manages data.
Use a four-point structure when teaching data structures to keep class consistent for optimal learning: introduce an abstract data type, cover implementation, demonstrate use, and review Big-O analysis.

For more information or to report a bug, contact us at admin@csteachingtips.org. Built with Bootstrap. Powered by Drupal.

Privacy Policy