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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online