Linear Data Structures 1.5

Linear Data Structures 1.5 - Last Updated: 12-01-17 9:52 AM...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Last Updated: 12-01-17 9:52 AM CSE 2011 Prof. J. Elder - 21 - Performance In the array based implementation The space used by the data structure is O ( n ) size , isEmpty , get and set run in O (1) time add and remove run in O ( n ) time In an add operation, when the array is full, instead of throwing an exception, we could replace the array with a larger one. In fact java.util.ArrayList implements this ADT using extendable arrays that do just this. Last Updated: 12-01-17 9:52 AM CSE 2011 Prof. J. Elder - 22 - End of Lecture 3 Last Updated: 12-01-17 9:52 AM CSE 2011 Prof. J. Elder - 22 - End of Lecture 3 Jan 10, 2012 Last Updated: 12-01-17 9:52 AM CSE 2011 Prof. J. Elder - 23 - Implementing Array Lists using Extendable Arrays In an add operation, when the array is full, instead of throwing an exception, we can replace the array with a larger one How large should the new array be?...
View Full Document

Page1 / 5

Linear Data Structures 1.5 - Last Updated: 12-01-17 9:52 AM...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online