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

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

1 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} 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 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

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

View Full Document
2 The relationships are usually specified by specifying operations on one or more instances. add, subtract, predecessor, multiply Data Structure 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 Linear List Examples/Instances Students in COP3530 = (Jack, Jill, Abe, Henry, Mary, …, Judy) Exams in COP3530 = (exam1, exam2, exam3) Days of Week = (S, M, T, W, Th, F, Sa) Months = (Jan, Feb, Mar, Apr, …, Nov, Dec)
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 7

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

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

View Full Document
Ask a homework question - tutors are online