lec04a - Data Structures data object set or collection of...

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

View Full Document Right Arrow Icon
Data Structures data object set or collection of instances integer = {0, +1, -1, +2, -2, +3, -3, …} daysOfWeek = {S,M,T,W,Th,F,Sa}
Background image of page 1

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

View Full DocumentRight Arrow Icon
Data Object instances may or may not be related myDataObject = {apple, chair, 2, 5.2, red, green, Jack}
Background image of page 2
Data Structure Data object + relationships that exist among instances and elements that comprise an instance Among instances of integer 369 < 370 280 + 4 = 284
Background image of page 3

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

View Full DocumentRight Arrow Icon
Data Structure Among elements that comprise an instance 369 3 is more significant than 6 3 is immediately to the left of 6 9 is immediately to the right of 6
Background image of page 4
The relationships are usually specified by specifying operations on one or more instances. add, subtract, predecessor, multiply Data Structure
Background image of page 5

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

View Full DocumentRight Arrow Icon
Linear (or Ordered) Lists instances are of the form (e 0 , e 1 , e 2 , …, e n-1 ) where e i denotes a list element n >= 0 is finite list size is n
Background image of page 6
Linear Lists L = (e 0 , e 1 , e 2 , e 3 , …, e n-1 ) relationships e 0 is the zero’th (or front) element e n-1 is the last element e i immediately precedes e i+1
Background image of page 7

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

View Full DocumentRight Arrow Icon
Linear List Examples Students in COP3530 = (Jack, Jill, Abe, Henry, Mary, …, Judy) Exams in COP3530 = (exam1, exam2, exam3) Days of Week = (S, M, T, W, R, F, Sa) Months = (Jan, Feb, Mar, Apr, …, Nov, Dec)
Background image of page 8
Linear List Operations—size() determine list size L = (a,b,c,d,e) size = 5
Background image of page 9

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

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

Page1 / 28

lec04a - Data Structures data object set or collection of...

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

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