{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

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}

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

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

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

View Full Document
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
The relationships are usually specified by specifying operations on one or more instances. add, subtract, predecessor, multiply Data Structure

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

View Full Document
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
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

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

View Full Document
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)
Linear List Operations—size() determine list size L = (a,b,c,d,e) size = 5

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online