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

Misconception: Students often have off by 1 errors when working with loops, which can result from mixing up > and >= as well as forgetting that arrays start at index 0.
Have students design a game of Asteroid in Java to introduce developing an object and class hierarchy.
Force students to explore inheritance and the Java APIs for ArrayList by writing code that HAS-A ArrayList or IS-A ArrayList.

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

Privacy Policy