0% found this document useful (0 votes)
19 views13 pages

1-What Is Data Structure

Uploaded by

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

1-What Is Data Structure

Uploaded by

kaled20188a
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Why are we studying Data Structures ?

Dealing with data…


• How to use it ?
• How to store it ?
• How to process it ?
• How to gain “knowledge” from it ?
• How to keep it secure?
What is Data Structure:
• A data structure is a storage that is used to store and
organize data. It is a way of arranging data on a computer
so that it can be accessed and updated efficiently.
• An efficient data structure also uses minimum memory
space and execution time to process the structure. The idea
is to reduce the space and time complexities of different
tasks.

• A data structure is not only used for organizing the data. It


is also used for processing, retrieving, and storing data.
• There are different basic and advanced types of data
structures that are used in almost every program or
software system that has been developed. So we must have
good knowledge about data structures.
Differences Between Data Type and Data
Structure
• Data Type

• The data type is the form of a variable to which a value can


be assigned. It defines that the particular variable will
assign the values of the given data type only.

• Data Structure

• Data structure is a collection of different kinds of data. That


entire data can be represented using an object and can be
used throughout the program.
Need Of Data structure :

• Data presentation must be easy to understand so the


developer, as well as the user, can make an efficient
implementation of the operation.

• Here is a list of the needs for data.

• Data structure modification is easy.


• It requires less time.
• Save storage memory space.
• Data representation is easy.
• Easy access to the large database.
Disadvantage of Data Structure:

• Increased computational and memory overhead.


Applications of Data Structures:
• Data structures are used in various fields such as:

• Operating system
• Graphics
• Games
• Genetics
• Image Processing
• Simulation,
• etc.
Data “Structures” Tools
• Arrays head

• Lists
• Stacks 2
1

• Queues 3 4
7 8
• Trees 5 6

F R

8
Linear Data Structure:
• Data structure in which data elements are arranged sequentially or
linearly, where each element is attached to its previous and next
adjacent elements, is called a linear data structure.

• Examples of linear data structures are array, stack, queue, linked list, etc.
• Static data structure: Static data structure has a fixed memory size. It is
easier to access the elements in a static data structure.
An example of this data structure is an array.

• Dynamic data structure: In dynamic data structure, the size is not fixed.
It can be randomly updated during the runtime which may be
considered efficient concerning the memory (space) complexity of the
code.
• Examples of this data structure are queue, stack, etc.
Non-linear data structure
• Data structures where data elements are not
placed sequentially or linearly are called non-
linear data structures. In a non-linear data
structure, we can’t traverse all the elements in
a single run only.
• Examples of non-linear data structures are
trees and graphs.
Arrays:
• An array is a linear data structure, and it is a collection of items stored at contiguous
memory locations.
• Operations performed on array:
• Initialization: An array can be initialized with values at the time of declaration or later using
an assignment statement.
• Accessing elements: Elements in an array can be accessed by their index, which starts from
0 and goes up to the size of the array minus one.
• Searching for elements: Arrays can be searched for a specific element using linear search
or binary search algorithms.
• Sorting elements: Elements in an array can be sorted in ascending or descending order
using algorithms like bubble sort, insertion sort, or quick sort.
• Inserting elements: Elements can be inserted into an array at a specific location, but this
operation can be time-consuming because it requires shifting existing elements in the
array.
• Deleting elements: Elements can be deleted from an array by shifting the elements that
come after it to fill the gap.
• Updating elements: Elements in an array can be updated or modified by assigning a new
value to a specific index.
• Traversing elements: The elements in an array can be traversed in order, visiting each
element once.

You might also like