Introduction to Data Structures
A data type is an instance of data that may be native to the language or defined by the user. And a
composition of data types, which forms some kind of systematic organization, is called Data
Structure.
Data structure = Organized data + Allowed operations
Simple Data structure can be used as building blocks of complex data structure.
Array is a simple type of Data structure by using which we can build more complex data structure.
Data structure can be classified according to the following four types.
1. Linear & Non-linear: The data stored in a sequence is called Linear, while the other is called
Non-linear e.g. Array is Linear & Tree is Non-linear.
2. Homogenous & Non-homogenous: The data structure, which contains single type of data, is
known as Homogenous whereas others are Non- homogenous. For example, Array is an ordered set
of homogenous elements stored in a contiguous memory location. And Record (structure) is a Non-
Homogenous.
3. Static & Dynamic: This means the allocation of memory, either Static or Dynamic.
4. Direct access & Sequential access: The ability of directly referring to an item without having access
to any other is called Direct access. Sequential access is searching through a number of items before
finding a specific item i.e. an item, which is not directly accessible. For example, arrays provide a
direct access to any element within the array by means of an index (direct access). But in linked lists,
we must traverse through the list to locate a specific node (sequential access). Some of the data
structures, which will be discussed in detail later in the book, are given below.
Arrays This is a simplest type of linear data structure (one dimensional array), by
means of which a set of finite number say n of similar data elements can be referenced
by a set of n consecutive numbers 1, 2, 3, …….. n. For example, consider the following list
of elements: 5, 6, 8, 4, 3, 1, 2, 56, 67, 78 This list of 10 elements can be stored in an array
of size 10 as
follows:
Note: Arrays will not be discussed hereafter in this book. It will be presumed that the
reader is familiar with arrays.