Linear Data Structures 1.5

Linear Data Structures 1.5 - Last Updated 9:52 AM CSE 2011...

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

This note was uploaded on 02/14/2012 for the course CSE 2011Z taught by Professor Elder during the Fall '11 term at York University.

Page1 / 5

Linear Data Structures 1.5 - Last Updated 9:52 AM CSE 2011...

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