Page 10 - DCAP201_FUNDAMENTALS_OF_DATA_STRUCTURES
P. 10
Unit 1: Data Structures
This three-step approach to selecting a data structure operationalises a data centered view of the Notes
design process. The first concern is for the data and the operations to be performed on them, the
next concern is the representation for those data, and the final concern is the implementation of
that representation.
Resource constraints on certain key operations, such as search, inserting data records, and deleting
data records, normally drive the data structure selection process. Many issues relating to the
relative importance of these operations are addressed by the following three questions, which
you should ask yourself whenever you must choose a data structure:
Are all data items inserted into the data structure at the beginning, or are insertions
interspersed with other operations?
Can data items be deleted?
Are all data items processed in some well-defined order, or is search for specific data items
allowed?
Typically, interspersing insertions with other operations, allowing deletion, and supporting
search for data items all require more complex representations.
Self Assessment
Fill in the blanks:
1. A ........................ is a scheme for organizing data in the memory of a computer.
2. ........................ on certain key operations normally drive the data structure selection process.
1.2 Concept of Data Type
A data type is a method of interpreting a pattern of bits.
C uses data types to describe various kinds of data such as integers, floating-point numbers,
characters, etc. In C, an object refers to a memory location where its content represents a value.
If you assign an object a name, that object becomes a variable. A data type determines the
number of bytes to be allocated to the variable and valid operations can be performed on it.
C provides you with various data types that can be classified into the following groups:
Basic type includes standard and extended integer types
Enumerated types contains real and complex floating-point types
Derived types include pointer types, array types, structure types, union types and function
types
Type void
Did u know? Function type depicts the interface of a function. It specifies types of parameters
and return type of the function.
C data types can be also classified differently into the following groups:
Arithmetic types include basic types and enumerated types
Scalar types include arithmetic types and pointer types
Aggregate types include array types and structure types.
LOVELY PROFESSIONAL UNIVERSITY 3