0% found this document useful (0 votes)
13 views8 pages

Module I Basic Concept

The document provides an overview of data structures, defining them as methods for organizing data in memory, with classifications into primitive and non-primitive types. It discusses linear and non-linear data structures, their operations, and the importance of selecting appropriate data structures for efficiency in programming. Additionally, it highlights the advantages of data structures, their objectives of correctness and efficiency, and key terminologies related to data structures.

Uploaded by

mutharasi.s
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views8 pages

Module I Basic Concept

The document provides an overview of data structures, defining them as methods for organizing data in memory, with classifications into primitive and non-primitive types. It discusses linear and non-linear data structures, their operations, and the importance of selecting appropriate data structures for efficiency in programming. Additionally, it highlights the advantages of data structures, their objectives of correctness and efficiency, and key terminologies related to data structures.

Uploaded by

mutharasi.s
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

OVERVIEW OF SYSTEM LIFE CYCLE:

What is Data Structure?


 The data structure name indicates itself that organizing the data in
memory.
 There are many ways of organizing the data in the memory as we have
already seen one of the data structures, i.e., array in C language. Array is
a collection of memory elements in which data is stored sequentially,
i.e., one after another.
 This organization of data is done with the help of an array of data
structures. There are also other ways to organize the data in memory.

 The data structure is not any programming language like C, C++, java,
etc. It is a set of algorithms that we can use in any programming
language to structure the data in the memory.
 To structure the data in memory, 'n' number of algorithms were
proposed, and all these algorithms are known as Abstract data types.
These abstract data types are the set of rules.
Types of Data Structures
There are two types of data structures:

o Primitive data structure


o Non-primitive data structure

Primitive Data Structures

1. Primitive Data Structures are the data structures consisting of the


numbers and the characters that come in-built into programs.
2. These data structures can be manipulated or operated directly by
machine-level instructions.
3. Basic data types like Integer, Float, Character, and Boolean come
under the Primitive Data Structures.
4. These data types are also called Simple data types, as they contain
characters that can't be divided further
Non-Primitive Data Structures

1. Non-Primitive Data Structures are those data structures derived from


Primitive Data Structures.
2. These data structures can't be manipulated or operated directly by
machine-level instructions.
3. The focus of these data structures is on forming a set of data elements
that is either homogeneous (same data type)
or heterogeneous (different data types).
4. Based on the structure and arrangement of data, we can divide these
data structures into two sub-categories -
a. Linear Data Structures
b. Non-Linear Data Structures

Data structures can also be classified as:

o Static data structure: It is a type of data structure where


the size is allocated at the compile time. Therefore, the
maximum size is fixed.
o Dynamic data structure: It is a type of data structure
where the size is allocated at the run time. Therefore, the
maximum size is flexible.

Linear Data Structures


A data structure that preserves a linear connection among its data elements is
known as a Linear Data Structure. The arrangement of the data is done
linearly, where each element consists of the successors and predecessors
except the first and the last data element. However, it is not necessarily true in
the case of memory, as the arrangement may not be sequential.
Based on memory allocation, the Linear Data Structures are further classified
into two types:

1. Static Data Structures: The data structures having a fixed size are
known as Static Data Structures. The memory for these data structures is
allocated at the compiler time, and their size cannot be changed by the
user after being compiled; however, the data stored in them can be
altered.
The Array is the best example of the Static Data Structure as they have a
fixed size, and its data can be modified later.
2. Dynamic Data Structures: The data structures having a dynamic size
are known as Dynamic Data Structures. The memory of these data
structures is allocated at the run time, and their size varies during the
run time of the code. Moreover, the user can change the size as well as
the data elements stored in these data structures at the run time of the
code.
Linked Lists, Stacks, and Queues are common examples of dynamic
data structures

[Link]-Linear Data Structures

When one element is connected to the 'n' number of


elements known as a non-linear data structure. The best
example is trees and graphs. In this case, the elements are
arranged in a random manner.
Major Operations
The major or the common operations that can be performed on the data
structures are:

o Searching: We can search for any element in a data structure.


o Sorting: We can sort the elements of a data structure either in an
ascending or descending order.
o Insertion: We can also insert the new element in a data structure.
o Updation: We can also update the element, i.e., we can replace the
element with another element.
o Deletion: We can also perform the delete operation to remove the
element from the data structure.

Which Data Structure?


A data structure is a way of organizing the data so that it can be used
efficiently. Here, we have used the word efficiently, which in terms of both the
space and time. For example, a stack is an ADT (Abstract data type) which uses
either arrays or linked list data structure for the implementation. Therefore, we
conclude that we require some data structure to implement a particular ADT.

An ADT tells what is to be done and data structure tells how it is to be done.
In other words, we can say that ADT gives us the blueprint while data structure
provides the implementation part. Now the question arises: how can one get
to know which data structure to be used for a particular ADT?.

As the different data structures can be implemented in a particular ADT, but


the different implementations are compared for time and space. For example,
the Stack ADT can be implemented by both Arrays and linked list. Suppose the
array is providing time efficiency while the linked list is providing space
efficiency, so the one which is the best suited for the current user's
requirements will be selected.

Advantages of Data structures


The following are the advantages of a data structure:

o Efficiency: If the choice of a data structure for implementing a particular


ADT is proper, it makes the program very efficient in terms of time and
space.
o Reusability: The data structure provides reusability means that multiple
client programs can use the data structure.
o Abstraction: The data structure specified by an ADT also provides the
level of abstraction. The client cannot see the internal working of the
data structure, so it does not have to worry about the implementation
part. The client can only see the interface.

Why should we learn Data Structures?

1. Data Structures and Algorithms are two of the key aspects of Computer
Science.
2. Data Structures allow us to organize and store data, whereas Algorithms
allow us to process that data meaningfully.
3. Learning Data Structures and Algorithms will help us become better
Programmers.
4. We will be able to write code that is more effective and reliable.
5. We will also be able to solve problems more quickly and efficiently.
Understanding the Objectives of Data Structures
Data Structures satisfy two complementary objectives:

1. Correctness: Data Structures are designed to operate correctly for all


kinds of inputs based on the domain of interest. In order words,
correctness forms the primary objective of Data Structure, which always
depends upon the problems that the Data Structure is meant to solve.
2. Efficiency: Data Structures also requires to be efficient. It should
process the data quickly without utilizing many computer resources like
memory space. In a real-time state, the efficiency of a data structure is a
key factor in determining the success and failure of the process.

Understanding some Key Features of Data


Structures
Some of the Significant Features of Data Structures are:

1. Robustness: Generally, all computer programmers aim to produce


software that yields correct output for every possible input, along with
efficient execution on all hardware platforms. This type of robust
software must manage both valid and invalid inputs.
2. Adaptability: Building software applications like Web Browsers, Word
Processors, and Internet Search Engine include huge software systems
that require correct and efficient working or execution for many years.
Moreover, software evolves due to emerging technologies or ever-
changing market conditions.
3. Reusability: The features like Reusability and Adaptability go hand in
hand. It is known that the programmer needs many resources to build
any software, making it a costly enterprise. However, if the software is
developed in a reusable and adaptable way, then it can be applied in
most future applications. Thus, by executing quality data structures, it is
possible to build reusable software, which appears to be cost-effective
and timesaving.

Basic Terminologies related to Data Structures


Data Structures are the building blocks of any software or program. Selecting
the suitable data structure for a program is an extremely challenging task for a
programmer.

The following are some fundamental terminologies used whenever the data
structures are involved:

1. Data: We can define data as an elementary value or a collection of


values. For example, the Employee's name and ID are the data related to
the Employee.
2. Data Items: A Single unit of value is known as Data Item.
3. Group Items: Data Items that have subordinate data items are known as
Group Items. For example, an employee's name can have a first, middle,
and last name.
4. Elementary Items: Data Items that are unable to divide into sub-items
are known as Elementary Items. For example, the ID of an Employee.
5. Entity and Attribute: A class of certain objects is represented by an
Entity. It consists of different Attributes. Each Attribute symbolizes the
specific property of that Entity. For example,

Attributes ID Name Gender Job Title


Values 1234 Stacey M. Hill Female Software
Developer

You might also like