CSC 252 LECTURE 1 Intro To Data Structure
CSC 252 LECTURE 1 Intro To Data Structure
Records
A record is a special type of data structure that, unlike arrays, collects different data types that
define a particular structure such a book, product, person and many others. A record is a
collection of fields, possibly of different data types, typically in fixed number and sequence. The
fields of a record may also be called members, particularly in object-oriented programming. For
example, a date could be stored as a record containing a numeric year field, a month field
represented as a string, and a numeric day-ofmonth field. A Personnel record might contain a
name, a salary, and a rank. Records are distinguished from arrays by the fact that their number of
fields is typically fixed, each field has a name, and that each field may have a different type. A
record type is a data type that describes such values and variables. Most modern computer
languages allow the programmer to define new record types. The definition includes specifying
the data type of each field and an identifier (name or label) by which it can be accessed. Records
can exist in any storage medium, including main memory and mass storage devices such as
magnetic tapes or hard disks. Records are a fundamental component of most data structures,
especially linked data structures. Many computer files are organized as arrays of logical records,
often grouped into larger physical records or blocks for efficiency.