Page 13 - DCAP407_DATA_STRUCTURE
P. 13
Data Structure
In a linear search algorithm, the lower bound is expressed as (1) and the
upper bound as (n).
1.2 Need for Data Structures
The study of data structure helps programmers to store and manipulate data efficiently. Data structures
help to understand the relationship of a data element with other data elements. They also provide
various methods to organize and represent the data within the computer’s memory.
Data structure is imperative since it governs the types of operations we perform on the data, and the
competency of the operations carried out. It also governs how dynamic we can be in dealing with our
data.
Data structures specify if we can add additional data on the fly, or if we need to know
about all the data initially. We determine which data structures to use for storing our
data only after we have vigilantly analyzed the problem and know what we are
expected to do with the data.
There are different ways to organize data, for which there is a need for different kinds of data structure.
Consider a set of data that represents points of interest in a country. For each point of interest, the
location is represented by country name in the first level, then the state name and finally the point of
interest. Here, data is organized in a hierarchical form and hence it needs a hierarchical type of data
structure as shown in figure 1.1.
Figure 1.1: Hierarchical Type of Data Structure
India
Karnataka Delhi Maharashtra
Bangalore
Red Fort Mumbai
Lalbagh
Juhu Beach
There are more real world scenarios, where the data structure is implemented effectively to manage the
data.
Banks perform many operations such as opening accounts, closing accounts,
adding money, and withdrawing money from an account. Hence, banking
applications need appropriate data structures for their database system. The data
structure should be such that it can efficiently handle search operations as well
as basic functions like randomly inserting and deleting the data items from
anywhere in the structure.
6 LOVELY PROFESSIONAL UNIVERSITY