07-TupleADT - 1 Tuple Abstract Data Type Gunnar Gotshalks...

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

View Full Document Right Arrow Icon
1 Tuple Abstract Data Type Gunnar Gotshalks 2007 December Table of Contents Introduction . ............................................................................................................................... 1 The tuple object . ........................................................................................................................ 2 The tuple fields . ......................................................................................................................... 3 Operations on tuples . ................................................................................................................ 4 Enquiry operations .............................................................................................................. 4.1 Read operations .................................................................................................................. 4.2 Write operations .................................................................................................................. 4.3 Storage allocation and variant tuples . ..................................................................................... 5 1 Introduction The value of defining tuples as an abstract data type is primarily for systems programmers. We do not go into detailed program implementations. A tuple is a heterogeneous collection of variables of different types. By combining the variables into a single unit, it becomes possible to abstract information into larger units and to pass a smaller amount of explicit information among abstract data type operations. Note: tuples are also called records. Arrays and tuples are complementary in that arrays are a homogenous collection of variables all of the same type, while tuples are a heterogenous collection of variables of potentially different types. This complementary aspect also appears in the ease with which elements from the structure can be accessed. For arrays it is simple; for tuples it is more complex. That is why the tuple structure is less often a part of programming languages than arrays. In the C and C++ languages tuples are represented by the struct statement.
Background image of page 1

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

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

This note was uploaded on 02/14/2012 for the course CSE 3214 taught by Professor Ross during the Winter '12 term at York University.

Page1 / 4

07-TupleADT - 1 Tuple Abstract Data Type Gunnar Gotshalks...

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

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