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.

Share 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. with FacebookShare 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. with Twitter
  • 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

Explicitly discuss the lack of bounds-checking in C-based courses to avoid student confusion when using strings and arrays.
Use patternCoder to help students move from conceptual model classes to code by selecting class relationships that reflect the system they want to create in Java.
Misconception: In Java, students don’t realize that methods are inherited, but constructors are not.

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

Privacy Policy