SlideShare a Scribd company logo
1 of 36
Download to read offline
INTRODUCTION TO
DATA STRUCTURES
Lesson 1 – Data Structures and Algorithm
MR. ROWELL L. MARQUINA
IT Instructor, PUP Biñan
WHAT IS A
DATA STRUCTURE?
What is Data?
Data is a set of discrete or continuous
values that convey information by
representing quantity, quality, fact,
statistics, or other basic units of
meaning, or simply sequences of
symbols that can be formally
understood.
IMAGE SOURCE: https://businessfig.com/wp-content/uploads/2023/02/how-to-learn-big-data-7-places-to-start-in-2022.jpg
It is commonly arranged into tables
to provide more context and
definition to it.
What is Data?
The term "data" was first used to
refer to "transmissible and storable
computer information" in 1946.
IMAGE SOURCE: https://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Data_types_-_en.svg/1200px-Data_types_-_en.svg.png
Examples of Data:
▪ name
▪ height
▪ address
▪ temperature
▪ salary
▪ device model number
What is Data Structure?
IMAGE SOURCE: https://miro.medium.com/v2/resize:fit:753/1*3hSAy-MRkYgKIp6ybUdjjw.png
Data Structure is a branch of computer Science that deals with how
data can be stored, organized, and retrieved in the most efficient way
possible.
WHY LEARN
DATA STRUCTURE
AND ALGORITHM?
Why Learn Data Structure?
IMAGE SOURCE: https://c8.alamy.com/comp/2DAKBX0/data-volume-analysis-and-computer-science-industry3d-illustrationdata-structure-and-information-tools-for-
networking-business-2DAKBX0.jpg
Two of the most significant areas of
computer science are data structure
and algorithms.
▪ Proficiency in data structures
enable us to organize and store
data in the most efficient way
possible.
▪ Proficiency in algorithms enable us
to process that data more
meaningfully.
OBJECTIVES OF DATA STRUCTURE
CORRECTNESS
It entails that the data structure implementation should always
adhere to the set specifications and the outputs is grounded in
the expectations set for the program.
EFFICIENCY
Data structures must also be efficient. It should process data
fast without consuming a lot of computer resources, such as
memory space.
FEATURES OF DATA STRUCTURE:
ROBUSTNESS
All computer program must yield accurate responses for every
possible input by the user. Programs should be able to respond
accurately with valid and invalid inputs.
ADAPTABILITY
Computer programs are expected to be able to adjust to evolving
technologies and industry conventions.
REUSABILITY
Computer programs must be able to reuse the resources they use to
help future applications.
OPERATIONS ON
DATA STRUCTURES
OPERATIONS ON DATA STRUCTURE
There are six operations involving Data Structures:
▪ Searching
▪ Insertion
▪ Deletion
▪ Sorting
▪ Merging
▪ Updating
OPERATIONS ON DATA STRUCTURE
SEARCHING
Searching is the process of locating a certain data within a given data
structure.
INSERTION
Insertion refers to the method of adding a new element to a data structure.
DELETION
Deletion is a method use to remove data from a data structures.
SORTING
Sorting is the action of organizing the data elements in a data
structure in a predetermined order (ascending or descending).
OPEARTIONS ON DATA STRUCTURES
MERGING
Merging can be considered simply appending a group of elements from
one data structure after elements from another data structure with the
same element structure.
UPDATING
Updating is a method where a data structure is revisited for performing
specific changes.
CLASSIFICATION OF
DATA STRUCTURES
CLASSIFICATION OF DATA STRUCTURES
Data Structures can be classified
into two categories:
▪ Primitive Data Structure
▪Non-Primitive Data Structure
IMAGE SOURCE: https://static.javatpoint.com/ds/images/primitive-vs-non-primitive-data-structure.png
PRIMITIVE DATA
STRUCTURES
Primitive Data Structures is the
most elementary kind of data used
in programming language
composed of character, number,
and Boolean.
IMAGE SOURCE: https://www.shiksha.com/online-courses/articles/wp-content/uploads/sites/11/2022/05/image-162.png
These data types are also known as
simple Data Types since they
include characters that cannot be
further subdivided.
PRIMITIVE DATA STRUCTURES
byte refers to 8-bit signed two's complement integers that ranges from -128 to 127
short refers to 16-bit signed two's complement integer that ranges from -32,768 to 32,767
int
refers to 32-bit signed two's complement integer that ranges from -2,147,483,648 to
2,147,483,647
long
refers to 64-bit two's complement integer that ranges from -9,223,372,036,854,775,808
to 9,223,372,036,854,775,807
float
refers to single-precision 32-bit IEEE 754 floating point numbers that has a precision of
up to 7-digits after the decimal point.
double
refers to single-precision 64-bit IEEE 754 floating point numbers that has a precision of
up to 15-digits after the decimal point.
char
refers to a single 16-bit Unicode character that is used to store a single character. It can
be a single letter, number, or symbol.
Boolean
refers to the data type that can only store any of the two reserved values of either true
or false.
PRIMITIVE DATA STRUCTURES
NON-PRIMITIVE
DATA STRUCTURES
NON-PRIMITIVE DATA STRUCTURES
Non-Primitive Data Structures are objects
or instances constructed by the
programmer rather than defined by the
programming language.
IMAGE SOURCE: https://www.shiksha.com/online-courses/articles/wp-content/uploads/sites/11/2022/05/image-166.png
They are also known as "reference
variables" or "object references" since
they refer to a memory region where the
data is stored.
NON-PRIMITIVE DATA STRUCTURES
We can divide these data structures
into two sub-categories based on the
structure and placement of the data:
▪ Linear Data Structures
▪ Non-Linear Data Structures
IMAGE SOURCE: https://cdn.discuss.boardinfinity.com/original/2X/2/21a0512ec5a8a8c9175277c007f783a01b2c08e2.png
LINEAR DATA
STRUCTURES
LINEAR DATA STRUCTURES
The Linear Data Structure is the
data structure where data
elements are constructed
sequentially or follow a linear
trend. The elements are
adjacently attached and in a
specified order.
IMAGE SOURCE: https://cdn.discuss.boardinfinity.com/original/2X/2/21a0512ec5a8a8c9175277c007f783a01b2c08e2.png
LINEAR DATA STRUCTURES
There are five types of Linear Data Structures:
▪ Array
▪ Stack
▪ Queue
▪ Linked List
▪ Hash Tables
LINEAR DATA STRUCTURES
ARRAY
Is a type of linear data structure that stores elements of the
same data type in memory locations that are adjacent to each
other. Each element in an array is given an index number for
easier identification.
IMAGE SOURCE: https://www.geeksforgeeks.org/c-arrays/
LINEAR DATA STRUCTURES
STACK
A stack is a linear data structure
characterized by the LIFO (Last-In-
First-Out) approach, whereby
items are added and removed like
a pile, with new elements placed on
top of existing ones.
IMAGE SOURCE: https://miro.medium.com/v2/resize:fit:1400/1*tQ9Y11OdaMnhXwbfCF-edA.gif
LINEAR DATA STRUCTURES
Push method is used to enter
an element to the pile.
IMAGE SOURCE: https://miro.medium.com/v2/resize:fit:1400/1*tQ9Y11OdaMnhXwbfCF-edA.gif
Pop method is used to remove
an element from the file.
LINEAR DATA STRUCTURES
QUEUE
A queue is a linear data structure that employs the First In, First Out
(FIFO) approach for accessing its elements. Within the queue,
adding items to the list occurs exclusively at one end, whereas
removing items from the list occurs solely at the opposite end.
IMAGE SOURCE: https://ds1-iiith.vlabs.ac.in/exp/breadth-first-search/images/circular%20queue.gif
LINEAR DATA STRUCTURES
LINKED LIST
The linked list is the type of
linear data structure that stores
data elements through
interconnected nodes, with
each node containing the data
and the address to the next
node in the sequence.
IMAGE SOURCE: https://scaler-topics-articles-md.s3.us-west-2.amazonaws.com/insertion-operation-of-linked-list.gif
LINEAR DATA STRUCTURES
HASH TABLES
Hash tables are a type of linear
data structure that uses a hash
function to generate a key that
points to the address and value
of each element.
IMAGE SOURCE: https://scaler-topics-articles-md.s3.us-west-2.amazonaws.com/insertion-operation-of-linked-list.gif
NON-LINEAR
DATA STRUCTURES
NON-LINEAR DATA STRUCTURES
A Non-Linear Data Structure is a
type of data structure in which the
arrangement of data elements
does not follow a sequential or
linear trend. In these type of data
structure, the data elements are
stored in hierarchical or a
network-based structure.
IMAGE SOURCE: https://cdn.discuss.boardinfinity.com/original/2X/2/21a0512ec5a8a8c9175277c007f783a01b2c08e2.png
NON-LINEAR DATA STRUCTURES
There are Two Types of
Non-Linear Data Structures:
▪ Tree Data Structure
▪ Graph Data Structure
IMAGE SOURCE: https://cdn.discuss.boardinfinity.com/original/2X/2/21a0512ec5a8a8c9175277c007f783a01b2c08e2.png
NON-LINEAR DATA STRUCTURES
TREE DATA STRUCTURE
A tree is a type of data structure
that hierarchically organizes data.
It is a compilation of
interconnected nodes linked
together via edges. In each
structure, every node possesses a
parent node and may have an
arbitrary number of child nodes.
IMAGE SOURCE: https://res.cloudinary.com/practicaldev/image/fetch/s--zaYuwulZ--
/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w0z2pz1f7th1k0ut8rbr.gif
NON-LINEAR DATA STRUCTURES
GRAPH DATA STRUCTURE
Graphs Data Structures are non-
linear data structures composed of a
finite number of interconnected
vertices and edges.
IMAGE SOURCE: https://miro.medium.com/v2/resize:fit:1208/1*SSSa5VrhhjNrXDdWTBGXlA.gif
The vertices (nodes) are responsible
for storing the data elements, while
the edges conveys the relationships
between the vertices.
INTRODUCTION TO
DATA STRUCTURES
MR. ROWELL L. MARQUINA
Professional Lecturer,
Polytechnic University of the Philippines
Email Address:
rowell.marquina001@deped.gov.ph
sirrowellmarquina@gmail.com
rmarquina@mitis.edu.ph

More Related Content

What's hot

Dynamic memory allocation in c++
Dynamic memory allocation in c++Dynamic memory allocation in c++
Dynamic memory allocation in c++
Tech_MX
 
Design concepts and principles
Design concepts and principlesDesign concepts and principles
Design concepts and principles
saurabhshertukde
 
Applet life cycle
Applet life cycleApplet life cycle
Applet life cycle
myrajendra
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS
koolkampus
 

What's hot (20)

Basic html structure
Basic html structureBasic html structure
Basic html structure
 
Html Frames
Html FramesHtml Frames
Html Frames
 
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
 
Dynamic memory allocation in c++
Dynamic memory allocation in c++Dynamic memory allocation in c++
Dynamic memory allocation in c++
 
HTML and DHTML
HTML and DHTMLHTML and DHTML
HTML and DHTML
 
Vectors in Java
Vectors in JavaVectors in Java
Vectors in Java
 
Design concepts and principles
Design concepts and principlesDesign concepts and principles
Design concepts and principles
 
File Management in Operating Systems
File Management in Operating SystemsFile Management in Operating Systems
File Management in Operating Systems
 
JavaScript Arrays
JavaScript Arrays JavaScript Arrays
JavaScript Arrays
 
Operating Systems: Device Management
Operating Systems: Device ManagementOperating Systems: Device Management
Operating Systems: Device Management
 
Degree of relationship set
Degree of relationship setDegree of relationship set
Degree of relationship set
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Applet life cycle
Applet life cycleApplet life cycle
Applet life cycle
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
VB.net
VB.netVB.net
VB.net
 
27 iframe
27 iframe27 iframe
27 iframe
 
Java applets
Java appletsJava applets
Java applets
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS
 
behavioral model (DFD & state diagram)
behavioral model (DFD & state diagram)behavioral model (DFD & state diagram)
behavioral model (DFD & state diagram)
 
Type casting
Type castingType casting
Type casting
 

Similar to DSA Lesson 1 - Introduction to Data Structures.pdf

Similar to DSA Lesson 1 - Introduction to Data Structures.pdf (20)

Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Ch1
Ch1Ch1
Ch1
 
Data structure
Data structureData structure
Data structure
 
DSA - Copy.pptx
DSA - Copy.pptxDSA - Copy.pptx
DSA - Copy.pptx
 
Data structure and its types.
Data structure and its types.Data structure and its types.
Data structure and its types.
 
UNIT II.docx
UNIT II.docxUNIT II.docx
UNIT II.docx
 
.DATA STRUCTURES
.DATA STRUCTURES  .DATA STRUCTURES
.DATA STRUCTURES
 
Data structures
Data structuresData structures
Data structures
 
Datastructures Notes
Datastructures NotesDatastructures Notes
Datastructures Notes
 
2. Chapter Two.pdf
2. Chapter Two.pdf2. Chapter Two.pdf
2. Chapter Two.pdf
 
Data structures and algorithm
Data structures and algorithmData structures and algorithm
Data structures and algorithm
 
MASTERING DATA STRUCTURES AND ALGORITHMS (1).pdf
MASTERING DATA STRUCTURES AND ALGORITHMS (1).pdfMASTERING DATA STRUCTURES AND ALGORITHMS (1).pdf
MASTERING DATA STRUCTURES AND ALGORITHMS (1).pdf
 
Complete book Database management systems Handbook 3rd edition by Muhammad Sh...
Complete book Database management systems Handbook 3rd edition by Muhammad Sh...Complete book Database management systems Handbook 3rd edition by Muhammad Sh...
Complete book Database management systems Handbook 3rd edition by Muhammad Sh...
 
Complete book Database management systems Handbook 3rd edition by Muhammad Sh...
Complete book Database management systems Handbook 3rd edition by Muhammad Sh...Complete book Database management systems Handbook 3rd edition by Muhammad Sh...
Complete book Database management systems Handbook 3rd edition by Muhammad Sh...
 
Full book Database system Handbook 3rd edition by Muhammad Sharif.pdf
Full book Database system Handbook 3rd edition by Muhammad Sharif.pdfFull book Database system Handbook 3rd edition by Muhammad Sharif.pdf
Full book Database system Handbook 3rd edition by Muhammad Sharif.pdf
 
Full book Database system Handbook 3rd edition by Muhammad Sharif.pdf
Full book Database system Handbook 3rd edition by Muhammad Sharif.pdfFull book Database system Handbook 3rd edition by Muhammad Sharif.pdf
Full book Database system Handbook 3rd edition by Muhammad Sharif.pdf
 
Complete book Database management systems Handbook 3rd edition by Muhammad Sh...
Complete book Database management systems Handbook 3rd edition by Muhammad Sh...Complete book Database management systems Handbook 3rd edition by Muhammad Sh...
Complete book Database management systems Handbook 3rd edition by Muhammad Sh...
 
20IT501_DWDM_PPT_Unit_II.ppt
20IT501_DWDM_PPT_Unit_II.ppt20IT501_DWDM_PPT_Unit_II.ppt
20IT501_DWDM_PPT_Unit_II.ppt
 
Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...
 
20IT501_DWDM_PPT_Unit_II.ppt
20IT501_DWDM_PPT_Unit_II.ppt20IT501_DWDM_PPT_Unit_II.ppt
20IT501_DWDM_PPT_Unit_II.ppt
 

More from ROWELL MARQUINA

QMMS Lesson 2 - Using Excel Formula.pptx
QMMS Lesson 2 - Using Excel Formula.pptxQMMS Lesson 2 - Using Excel Formula.pptx
QMMS Lesson 2 - Using Excel Formula.pptx
ROWELL MARQUINA
 
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdfHCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
ROWELL MARQUINA
 
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ROWELL MARQUINA
 

More from ROWELL MARQUINA (20)

QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdf
 
QMMS Lesson 2 - Using Excel Formula.pptx
QMMS Lesson 2 - Using Excel Formula.pptxQMMS Lesson 2 - Using Excel Formula.pptx
QMMS Lesson 2 - Using Excel Formula.pptx
 
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdfHCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
 
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdfHCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
 
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdfDS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
 
ITSP Lesson 6 - Information Privacy.pdf
ITSP Lesson 6 - Information Privacy.pdfITSP Lesson 6 - Information Privacy.pdf
ITSP Lesson 6 - Information Privacy.pdf
 
ITSP Lesson 5 - Intellectual Property Rights.pdf
ITSP Lesson 5 - Intellectual Property Rights.pdfITSP Lesson 5 - Intellectual Property Rights.pdf
ITSP Lesson 5 - Intellectual Property Rights.pdf
 
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
 
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
 
CHF Lesson 2 - Software and Software Categories.pdf
CHF Lesson 2 - Software and Software Categories.pdfCHF Lesson 2 - Software and Software Categories.pdf
CHF Lesson 2 - Software and Software Categories.pdf
 
Animation Lesson 4 - Tools and Equipment in Animation.pdf
Animation Lesson 4 - Tools and Equipment in Animation.pdfAnimation Lesson 4 - Tools and Equipment in Animation.pdf
Animation Lesson 4 - Tools and Equipment in Animation.pdf
 
DSA Lesson 2 - Algorithm and Flowcharting.pdf
DSA Lesson 2 - Algorithm and Flowcharting.pdfDSA Lesson 2 - Algorithm and Flowcharting.pdf
DSA Lesson 2 - Algorithm and Flowcharting.pdf
 
Lesson 1 - Introduction to Programming .pdf
Lesson 1 - Introduction to Programming .pdfLesson 1 - Introduction to Programming .pdf
Lesson 1 - Introduction to Programming .pdf
 
Java Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdfJava Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdf
 
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdfAnimation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
 
Animation Lesson 2 - Environment and Market (Updated).pdf
Animation Lesson 2 - Environment and Market (Updated).pdfAnimation Lesson 2 - Environment and Market (Updated).pdf
Animation Lesson 2 - Environment and Market (Updated).pdf
 
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdfAnimation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
 
Personal Entrepreneurial Competencies (PECs).pdf
Personal Entrepreneurial Competencies (PECs).pdfPersonal Entrepreneurial Competencies (PECs).pdf
Personal Entrepreneurial Competencies (PECs).pdf
 
Environment and Market.pdf
Environment and Market.pdfEnvironment and Market.pdf
Environment and Market.pdf
 
Lesson 5 - Getting Input from Users.pdf
Lesson 5 - Getting Input from Users.pdfLesson 5 - Getting Input from Users.pdf
Lesson 5 - Getting Input from Users.pdf
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

DSA Lesson 1 - Introduction to Data Structures.pdf

  • 1. INTRODUCTION TO DATA STRUCTURES Lesson 1 – Data Structures and Algorithm MR. ROWELL L. MARQUINA IT Instructor, PUP Biñan
  • 2. WHAT IS A DATA STRUCTURE?
  • 3. What is Data? Data is a set of discrete or continuous values that convey information by representing quantity, quality, fact, statistics, or other basic units of meaning, or simply sequences of symbols that can be formally understood. IMAGE SOURCE: https://businessfig.com/wp-content/uploads/2023/02/how-to-learn-big-data-7-places-to-start-in-2022.jpg It is commonly arranged into tables to provide more context and definition to it.
  • 4. What is Data? The term "data" was first used to refer to "transmissible and storable computer information" in 1946. IMAGE SOURCE: https://upload.wikimedia.org/wikipedia/commons/thumb/6/6d/Data_types_-_en.svg/1200px-Data_types_-_en.svg.png Examples of Data: ▪ name ▪ height ▪ address ▪ temperature ▪ salary ▪ device model number
  • 5. What is Data Structure? IMAGE SOURCE: https://miro.medium.com/v2/resize:fit:753/1*3hSAy-MRkYgKIp6ybUdjjw.png Data Structure is a branch of computer Science that deals with how data can be stored, organized, and retrieved in the most efficient way possible.
  • 7. Why Learn Data Structure? IMAGE SOURCE: https://c8.alamy.com/comp/2DAKBX0/data-volume-analysis-and-computer-science-industry3d-illustrationdata-structure-and-information-tools-for- networking-business-2DAKBX0.jpg Two of the most significant areas of computer science are data structure and algorithms. ▪ Proficiency in data structures enable us to organize and store data in the most efficient way possible. ▪ Proficiency in algorithms enable us to process that data more meaningfully.
  • 8. OBJECTIVES OF DATA STRUCTURE CORRECTNESS It entails that the data structure implementation should always adhere to the set specifications and the outputs is grounded in the expectations set for the program. EFFICIENCY Data structures must also be efficient. It should process data fast without consuming a lot of computer resources, such as memory space.
  • 9. FEATURES OF DATA STRUCTURE: ROBUSTNESS All computer program must yield accurate responses for every possible input by the user. Programs should be able to respond accurately with valid and invalid inputs. ADAPTABILITY Computer programs are expected to be able to adjust to evolving technologies and industry conventions. REUSABILITY Computer programs must be able to reuse the resources they use to help future applications.
  • 11. OPERATIONS ON DATA STRUCTURE There are six operations involving Data Structures: ▪ Searching ▪ Insertion ▪ Deletion ▪ Sorting ▪ Merging ▪ Updating
  • 12. OPERATIONS ON DATA STRUCTURE SEARCHING Searching is the process of locating a certain data within a given data structure. INSERTION Insertion refers to the method of adding a new element to a data structure. DELETION Deletion is a method use to remove data from a data structures. SORTING Sorting is the action of organizing the data elements in a data structure in a predetermined order (ascending or descending).
  • 13. OPEARTIONS ON DATA STRUCTURES MERGING Merging can be considered simply appending a group of elements from one data structure after elements from another data structure with the same element structure. UPDATING Updating is a method where a data structure is revisited for performing specific changes.
  • 15. CLASSIFICATION OF DATA STRUCTURES Data Structures can be classified into two categories: ▪ Primitive Data Structure ▪Non-Primitive Data Structure IMAGE SOURCE: https://static.javatpoint.com/ds/images/primitive-vs-non-primitive-data-structure.png
  • 17. Primitive Data Structures is the most elementary kind of data used in programming language composed of character, number, and Boolean. IMAGE SOURCE: https://www.shiksha.com/online-courses/articles/wp-content/uploads/sites/11/2022/05/image-162.png These data types are also known as simple Data Types since they include characters that cannot be further subdivided. PRIMITIVE DATA STRUCTURES
  • 18. byte refers to 8-bit signed two's complement integers that ranges from -128 to 127 short refers to 16-bit signed two's complement integer that ranges from -32,768 to 32,767 int refers to 32-bit signed two's complement integer that ranges from -2,147,483,648 to 2,147,483,647 long refers to 64-bit two's complement integer that ranges from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 float refers to single-precision 32-bit IEEE 754 floating point numbers that has a precision of up to 7-digits after the decimal point. double refers to single-precision 64-bit IEEE 754 floating point numbers that has a precision of up to 15-digits after the decimal point. char refers to a single 16-bit Unicode character that is used to store a single character. It can be a single letter, number, or symbol. Boolean refers to the data type that can only store any of the two reserved values of either true or false. PRIMITIVE DATA STRUCTURES
  • 20. NON-PRIMITIVE DATA STRUCTURES Non-Primitive Data Structures are objects or instances constructed by the programmer rather than defined by the programming language. IMAGE SOURCE: https://www.shiksha.com/online-courses/articles/wp-content/uploads/sites/11/2022/05/image-166.png They are also known as "reference variables" or "object references" since they refer to a memory region where the data is stored.
  • 21. NON-PRIMITIVE DATA STRUCTURES We can divide these data structures into two sub-categories based on the structure and placement of the data: ▪ Linear Data Structures ▪ Non-Linear Data Structures IMAGE SOURCE: https://cdn.discuss.boardinfinity.com/original/2X/2/21a0512ec5a8a8c9175277c007f783a01b2c08e2.png
  • 23. LINEAR DATA STRUCTURES The Linear Data Structure is the data structure where data elements are constructed sequentially or follow a linear trend. The elements are adjacently attached and in a specified order. IMAGE SOURCE: https://cdn.discuss.boardinfinity.com/original/2X/2/21a0512ec5a8a8c9175277c007f783a01b2c08e2.png
  • 24. LINEAR DATA STRUCTURES There are five types of Linear Data Structures: ▪ Array ▪ Stack ▪ Queue ▪ Linked List ▪ Hash Tables
  • 25. LINEAR DATA STRUCTURES ARRAY Is a type of linear data structure that stores elements of the same data type in memory locations that are adjacent to each other. Each element in an array is given an index number for easier identification. IMAGE SOURCE: https://www.geeksforgeeks.org/c-arrays/
  • 26. LINEAR DATA STRUCTURES STACK A stack is a linear data structure characterized by the LIFO (Last-In- First-Out) approach, whereby items are added and removed like a pile, with new elements placed on top of existing ones. IMAGE SOURCE: https://miro.medium.com/v2/resize:fit:1400/1*tQ9Y11OdaMnhXwbfCF-edA.gif
  • 27. LINEAR DATA STRUCTURES Push method is used to enter an element to the pile. IMAGE SOURCE: https://miro.medium.com/v2/resize:fit:1400/1*tQ9Y11OdaMnhXwbfCF-edA.gif Pop method is used to remove an element from the file.
  • 28. LINEAR DATA STRUCTURES QUEUE A queue is a linear data structure that employs the First In, First Out (FIFO) approach for accessing its elements. Within the queue, adding items to the list occurs exclusively at one end, whereas removing items from the list occurs solely at the opposite end. IMAGE SOURCE: https://ds1-iiith.vlabs.ac.in/exp/breadth-first-search/images/circular%20queue.gif
  • 29. LINEAR DATA STRUCTURES LINKED LIST The linked list is the type of linear data structure that stores data elements through interconnected nodes, with each node containing the data and the address to the next node in the sequence. IMAGE SOURCE: https://scaler-topics-articles-md.s3.us-west-2.amazonaws.com/insertion-operation-of-linked-list.gif
  • 30. LINEAR DATA STRUCTURES HASH TABLES Hash tables are a type of linear data structure that uses a hash function to generate a key that points to the address and value of each element. IMAGE SOURCE: https://scaler-topics-articles-md.s3.us-west-2.amazonaws.com/insertion-operation-of-linked-list.gif
  • 32. NON-LINEAR DATA STRUCTURES A Non-Linear Data Structure is a type of data structure in which the arrangement of data elements does not follow a sequential or linear trend. In these type of data structure, the data elements are stored in hierarchical or a network-based structure. IMAGE SOURCE: https://cdn.discuss.boardinfinity.com/original/2X/2/21a0512ec5a8a8c9175277c007f783a01b2c08e2.png
  • 33. NON-LINEAR DATA STRUCTURES There are Two Types of Non-Linear Data Structures: ▪ Tree Data Structure ▪ Graph Data Structure IMAGE SOURCE: https://cdn.discuss.boardinfinity.com/original/2X/2/21a0512ec5a8a8c9175277c007f783a01b2c08e2.png
  • 34. NON-LINEAR DATA STRUCTURES TREE DATA STRUCTURE A tree is a type of data structure that hierarchically organizes data. It is a compilation of interconnected nodes linked together via edges. In each structure, every node possesses a parent node and may have an arbitrary number of child nodes. IMAGE SOURCE: https://res.cloudinary.com/practicaldev/image/fetch/s--zaYuwulZ-- /c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w0z2pz1f7th1k0ut8rbr.gif
  • 35. NON-LINEAR DATA STRUCTURES GRAPH DATA STRUCTURE Graphs Data Structures are non- linear data structures composed of a finite number of interconnected vertices and edges. IMAGE SOURCE: https://miro.medium.com/v2/resize:fit:1208/1*SSSa5VrhhjNrXDdWTBGXlA.gif The vertices (nodes) are responsible for storing the data elements, while the edges conveys the relationships between the vertices.
  • 36. INTRODUCTION TO DATA STRUCTURES MR. ROWELL L. MARQUINA Professional Lecturer, Polytechnic University of the Philippines Email Address: rowell.marquina001@deped.gov.ph sirrowellmarquina@gmail.com rmarquina@mitis.edu.ph