SlideShare a Scribd company logo
Ali Abdi Jama
DATA STRUCTURES & Algorithms
Analysis
USING Python
1
Overview
01
01
CHAPTER
Objectives: Introduction of Fundamental
Concepts
3
Overview of Data Structures
Overview of Algorithms
Some Definitions
Need of Data Structures
Advantages of Data Structures
Data Structure Classification
Operations on data structure
Overview of Data Structures
4
A data structure is a collection of data type ‘values’ which
are stored and organized in such a way that it allows for
efficient access and modification. In some cases a data
structure can become the underlying implementation for a
particular data.
It plays a vital role in enhancing the performance of a
software or a program as the main function of the software is
to store and retrieve the user's data as fast as possible
Overview of Data Structures
 Data structure is representation of the logical relationship
existing between individual elements of data.
 In other words, a data structure is a way of organizing all data
items that considers not only the elements stored but also their
relationship to each other.
 Program = Algorithm + Data Structure
5
Overview of Algorithm
 An algorithm is a set of instructions for solving a
problem or accomplishing a task.
 Algorithms are unambiguous specifications for
performing calculation, data processing, automated
reasoning, and other tasks.
6
Categories Of Algorithm
The major categories of algorithms are given below:
 Sort: Algorithm developed for sorting the items in certain order.
 Search: Algorithm developed for searching the items inside a
data structure.
 Delete: Algorithm developed for deleting the existing element
from the data structure.
 Insert: Algorithm developed for inserting an item inside a data
structure.
 Update: Algorithm developed for updating the existing element
inside a data structure.
7
Some Definitions
 Database:
Refers to all data that will be dealt with in particular situation.
We’ll assume that each item in a database has a similar format.
Example: A book using index cards,
 Record:
Records are the units into which a database is divided.
Ex :each card represents a record
8
Some Definitions
 Fields:
A record is usually divided into several fields. Fields hold a
particular kind of data. Example a person’s name, address
 Key:
Search for a record within a database using specific
key world. Eg search : name
9
Need of Data Structures
 As applications are getting complexed and amount of data is
increasing day by day, there may arise the following
problems:
 Processor speed: To handle very large amount of data, high
speed processing is required, but as the data is growing day by
day to the billions of files per entity, processor may fail to
deal with that much amount of data.
10
Need of Data Structures
 Data Search: Consider an inventory size of 106 items in a
store, If our application needs to search for a particular item, it
needs to traverse 106 items every time, results in slowing
down the search process.
 Multiple requests: If thousands of users are searching the
data simultaneously on a web server, then there are the
chances that a very large server can be failed during that
process
11
Need of Data Structures
in order to solve the above problems, data structures are used.
Data is organized to form a data structure in such a way that all
items are not required to be searched and required data can be
searched instantly.
12
Advantages of Data Structures
 Efficiency: Efficiency of a program depends upon the choice of
data structures. For example: suppose, we have some data and
we need to perform the search for a particular record. In that
case, if we organize our data in an array, we will have to search
sequentially element by element. hence, using array may not be
very efficient here. There are better data structures which can
make the search process efficient like binary search tree or hash
tables.
13
Advantages of Data Structures
 Reusability: Data structures are reusable, i.e. once we have
implemented a particular data structure, we can use it at any
other place.
 Abstraction: Data structure is specified by the ADT which
provides a level of abstraction. The client program uses the
data structure through interface only, without getting into the
implementation details.
14
Data Structure Classifications
15
Data structure
Primitive DS Non-Primitive DS
Integer Float Character Pointer
Float
Integer Float
Data Structure Classifications
16
Non-Primitive DS
Linear List Non-Linear List
Array
Link List Stack
Queue Graph Trees
Types Of Data Structure
 A primitive data structure is generally a basic structure
that is usually built into the language, such as an integer,
a float.
 A non-primitive data structure is built out of primitive
data structures linked together in meaningful ways, such
as a or a linked-list, binary search tree, AVL Tree, graph
etc.
17
Types Of Data Structure
Linear Data Structures:
A data structure is called linear if all of its elements are arranged in
the linear order. In linear data structures, the elements are stored in
non-hierarchical way.
Types of Linear Data Structures are given below:
 Arrays: An array is a collection of similar type of data items and
each data item is called an element of the array. The data type of the
element may be any valid data type like char, int, float or double.
18
Types Of Data Structure
 The elements of array share the same variable name but each
one carries a different index number known as subscript. The
array can be one dimensional, two dimensional or
multidimensional.
The individual elements of the array age are:
 age[0], age[1], age[2], age[3],......... age[98], age[99].
19
Types Of Data Structure
 Linked List:
Linked list is a linear data structure which is used to maintain a
list in the memory. It can be seen as the collection of nodes
stored at non-contiguous memory locations. Each node of the
list contains a pointer to its adjacent node.
20
Types Of Data Structure
 Stack: Stack is a data structure in which insertion
and deletion operations are performed at one end
only.
– The insertion operation is referred to as ‘PUSH’ and
deletion operation is referred to as ‘POP’ operation.
– Stack is also called as Last in First out (LIFO) data
structure.
21
Types Of Data Structure
 Queue: The data structure which permits the insertion at one
end and Deletion at another end, known as Queue.
– End at which deletion is occurs is known as FRONT end
and another end at which insertion occurs is known as
REAR end.
– Queue is also called as First in First out (FIFO) data
structure.
22
Types Of Data Structure
 Non Linear Data Structures:
This data structure does not form a sequence i.e. each item or
element is connected with two or more other items in a non-
linear arrangement. The data elements are not arranged in
sequential structure.
23
Types Of Data Structure
 Trees: Trees are multilevel data structures with a hierarchical
relationship among its elements known as nodes. The bottom most
nodes in the hierarchy are called leaf node while the top most node is
called root node. Each node contains pointers to point adjacent nodes.
 Tree data structure is based on the parent-child relationship among the
nodes. Each node in the tree can have more than one children except
the leaf nodes whereas each node can have at most one parent except
the root node.
24
Types Of Data Structure
 Graphs: Graphs can be defined as the pictorial representation
of the set of elements (represented by vertices) connected by
the links known as edges. A graph is different from tree in the
sense that a graph can have cycle while the tree can not have
the one.
25
Operations on data structure
 Searching:
The process of finding the location of an element within
the data structure is called Searching.
There are two algorithms to perform searching, Linear
Search and Binary Search. We will discuss each one of
them later .
26
Operations on data structure
 Insertion:
Insertion can be defined as the process of adding the elements
to the data structure at any location.
 Deletion:
The process of removing an element from the data structure is
called Deletion. We can delete an element from the data
structure at any random location.
27
Operations on data structure
 Searching:
The process of finding the location of an element within
the data structure is called Searching.
There are two algorithms to perform searching, Linear
Search and Binary Search. We will discuss each one of
them later .
28
Operations on data structure
 Traversing: Every data structure contains the set of
data elements. Traversing the data structure means
visiting each element of the data structure in order to
perform some specific operation like searching or
sorting.
29
Operations on data structure
 Sorting: The process of arranging the data structure in a specific
order is known as Sorting. There are many algorithms that can be
used to perform sorting, for example, insertion sort, selection sort,
bubble sort, etc.
 Merging:
When two lists List A and List B of size M and N respectively, of
similar type of elements, clubbed or joined to produce the third list,
List C of size (M+N), then this process is called merging
30
End
?
31

More Related Content

What's hot

Lecture1 data structure(introduction)
Lecture1 data structure(introduction)Lecture1 data structure(introduction)
Modern Database Systems - Lecture 00
Modern Database Systems - Lecture 00Modern Database Systems - Lecture 00
Modern Database Systems - Lecture 00
Michael Mathioudakis
 
Data resource management and DSS
Data resource management and DSSData resource management and DSS
Data resource management and DSS
RajThakuri
 
ความรู้เบื้องต้นฐานข้อมูล 1
ความรู้เบื้องต้นฐานข้อมูล 1ความรู้เบื้องต้นฐานข้อมูล 1
ความรู้เบื้องต้นฐานข้อมูล 1Witoon Thammatuch-aree
 
Ch 8 introduction to data structures
Ch 8 introduction to data structuresCh 8 introduction to data structures
Ch 8 introduction to data structuresChaffey College
 
Elementary data organisation
Elementary data organisationElementary data organisation
Elementary data organisationMuzamil Hussain
 
Data resource management
Data resource managementData resource management
Data resource management
Nirajan Silwal
 
Data Structure the Basic Structure for Programming
Data Structure the Basic Structure for ProgrammingData Structure the Basic Structure for Programming
Data Structure the Basic Structure for Programming
paperpublications3
 
Database Concepts
Database ConceptsDatabase Concepts
Database Concepts
Saradha Shyam
 
Introduction to Data Structures
Introduction to Data StructuresIntroduction to Data Structures
Introduction to Data Structures
nayanbanik
 
Data structure
Data  structureData  structure
Data structure
priyanka belekar
 
Database and types of database
Database and types of databaseDatabase and types of database
Database and types of database
baabtra.com - No. 1 supplier of quality freshers
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
Shaista Qadir
 
Over view of data structures
Over view of data structuresOver view of data structures
Over view of data structures
NagajothiN1
 
Basics of data structure
Basics of data structureBasics of data structure
Basics of data structure
Rajendran
 
Lecture 04 data resource management
Lecture 04 data resource managementLecture 04 data resource management
Lecture 04 data resource management
Dynamic Research Centre & institute
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
Suleman Memon
 

What's hot (19)

Lecture1 data structure(introduction)
Lecture1 data structure(introduction)Lecture1 data structure(introduction)
Lecture1 data structure(introduction)
 
Modern Database Systems - Lecture 00
Modern Database Systems - Lecture 00Modern Database Systems - Lecture 00
Modern Database Systems - Lecture 00
 
Data resource management and DSS
Data resource management and DSSData resource management and DSS
Data resource management and DSS
 
ความรู้เบื้องต้นฐานข้อมูล 1
ความรู้เบื้องต้นฐานข้อมูล 1ความรู้เบื้องต้นฐานข้อมูล 1
ความรู้เบื้องต้นฐานข้อมูล 1
 
Ch 8 introduction to data structures
Ch 8 introduction to data structuresCh 8 introduction to data structures
Ch 8 introduction to data structures
 
Elementary data organisation
Elementary data organisationElementary data organisation
Elementary data organisation
 
Data resource management
Data resource managementData resource management
Data resource management
 
Data Structure the Basic Structure for Programming
Data Structure the Basic Structure for ProgrammingData Structure the Basic Structure for Programming
Data Structure the Basic Structure for Programming
 
Database Concepts
Database ConceptsDatabase Concepts
Database Concepts
 
Data struters
Data strutersData struters
Data struters
 
Introduction to Data Structures
Introduction to Data StructuresIntroduction to Data Structures
Introduction to Data Structures
 
Data structure
Data  structureData  structure
Data structure
 
Database and types of database
Database and types of databaseDatabase and types of database
Database and types of database
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
Over view of data structures
Over view of data structuresOver view of data structures
Over view of data structures
 
Basics of data structure
Basics of data structureBasics of data structure
Basics of data structure
 
Lect 1-2
Lect 1-2Lect 1-2
Lect 1-2
 
Lecture 04 data resource management
Lecture 04 data resource managementLecture 04 data resource management
Lecture 04 data resource management
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
 

Similar to Ch1

Datastructures Notes
Datastructures NotesDatastructures Notes
Datastructures Notes
Ranjithkumar C
 
DSA - Copy.pptx
DSA - Copy.pptxDSA - Copy.pptx
DSA - Copy.pptx
BishalChowdhury10
 
UNIT II.docx
UNIT II.docxUNIT II.docx
UNIT II.docx
Revathiparamanathan
 
Unit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data StructuresresUnit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data Structuresres
amplopsurat
 
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...
Tutort Academy
 
DataStructurePpt.pptx
DataStructurePpt.pptxDataStructurePpt.pptx
DataStructurePpt.pptx
ssuser031f35
 
DataStructurePpt.pptx
DataStructurePpt.pptxDataStructurePpt.pptx
DataStructurePpt.pptx
DCABCA
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
SaralaT3
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Axmedcarb
 
DATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESDATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTES
suthi
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
sarala9
 
Unit-1 DataStructure Intro.pptx
Unit-1 DataStructure Intro.pptxUnit-1 DataStructure Intro.pptx
Unit-1 DataStructure Intro.pptx
ajajkhan16
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
adeel hamid
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
Adams Sidibe
 
Data Structure 1..Vary Basic introduction about DSA using c++.pptx
Data Structure 1..Vary Basic introduction  about DSA using c++.pptxData Structure 1..Vary Basic introduction  about DSA using c++.pptx
Data Structure 1..Vary Basic introduction about DSA using c++.pptx
vbthakur01
 
Data structure
Data structureData structure
Data structure
Prof. Dr. K. Adisesha
 
UNIT I - Data Structures.pdf
UNIT I - Data Structures.pdfUNIT I - Data Structures.pdf
UNIT I - Data Structures.pdf
KPRevathiAsstprofITD
 
Data structure (basics)
Data structure (basics)Data structure (basics)
Data structure (basics)
ShrushtiGole
 
Data Structure Ppt for our engineering college industrial training.
Data Structure Ppt  for our engineering college industrial training.Data Structure Ppt  for our engineering college industrial training.
Data Structure Ppt for our engineering college industrial training.
AnumaiAshish
 

Similar to Ch1 (20)

Datastructures Notes
Datastructures NotesDatastructures Notes
Datastructures Notes
 
DSA - Copy.pptx
DSA - Copy.pptxDSA - Copy.pptx
DSA - Copy.pptx
 
UNIT II.docx
UNIT II.docxUNIT II.docx
UNIT II.docx
 
Unit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data StructuresresUnit.1 Introduction to Data Structuresres
Unit.1 Introduction to Data Structuresres
 
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...
 
DataStructurePpt.pptx
DataStructurePpt.pptxDataStructurePpt.pptx
DataStructurePpt.pptx
 
DataStructurePpt.pptx
DataStructurePpt.pptxDataStructurePpt.pptx
DataStructurePpt.pptx
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
 
DATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESDATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTES
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
Unit-1 DataStructure Intro.pptx
Unit-1 DataStructure Intro.pptxUnit-1 DataStructure Intro.pptx
Unit-1 DataStructure Intro.pptx
 
Introduction to data structure
Introduction to data structureIntroduction to data structure
Introduction to data structure
 
Data Structures & Algorithms
Data Structures & AlgorithmsData Structures & Algorithms
Data Structures & Algorithms
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
 
Data Structure 1..Vary Basic introduction about DSA using c++.pptx
Data Structure 1..Vary Basic introduction  about DSA using c++.pptxData Structure 1..Vary Basic introduction  about DSA using c++.pptx
Data Structure 1..Vary Basic introduction about DSA using c++.pptx
 
Data structure
Data structureData structure
Data structure
 
UNIT I - Data Structures.pdf
UNIT I - Data Structures.pdfUNIT I - Data Structures.pdf
UNIT I - Data Structures.pdf
 
Data structure (basics)
Data structure (basics)Data structure (basics)
Data structure (basics)
 
Data Structure Ppt for our engineering college industrial training.
Data Structure Ppt  for our engineering college industrial training.Data Structure Ppt  for our engineering college industrial training.
Data Structure Ppt for our engineering college industrial training.
 

Recently uploaded

一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
74nqk8xf
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
jerlynmaetalle
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
John Andrews
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
vikram sood
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Subhajit Sahu
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
u86oixdj
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
slg6lamcq
 
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
u86oixdj
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
manishkhaire30
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
Subhajit Sahu
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
ahzuo
 
Nanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdfNanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdf
eddie19851
 
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTESAdjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Subhajit Sahu
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
v3tuleee
 
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
ahzuo
 
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptxData_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
AnirbanRoy608946
 
Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
Roger Valdez
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
Walaa Eldin Moustafa
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
rwarrenll
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
roli9797
 

Recently uploaded (20)

一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
 
Influence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business PlanInfluence of Marketing Strategy and Market Competition on Business Plan
Influence of Marketing Strategy and Market Competition on Business Plan
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
 
Global Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headedGlobal Situational Awareness of A.I. and where its headed
Global Situational Awareness of A.I. and where its headed
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
 
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
原版制作(Deakin毕业证书)迪肯大学毕业证学位证一模一样
 
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
一比一原版(UniSA毕业证书)南澳大学毕业证如何办理
 
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
原版制作(swinburne毕业证书)斯威本科技大学毕业证毕业完成信一模一样
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
 
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
一比一原版(CBU毕业证)卡普顿大学毕业证如何办理
 
Nanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdfNanandann Nilekani's ppt On India's .pdf
Nanandann Nilekani's ppt On India's .pdf
 
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTESAdjusting OpenMP PageRank : SHORT REPORT / NOTES
Adjusting OpenMP PageRank : SHORT REPORT / NOTES
 
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理一比一原版(UofS毕业证书)萨省大学毕业证如何办理
一比一原版(UofS毕业证书)萨省大学毕业证如何办理
 
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
一比一原版(UIUC毕业证)伊利诺伊大学|厄巴纳-香槟分校毕业证如何办理
 
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptxData_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
Data_and_Analytics_Essentials_Architect_an_Analytics_Platform.pptx
 
Everything you wanted to know about LIHTC
Everything you wanted to know about LIHTCEverything you wanted to know about LIHTC
Everything you wanted to know about LIHTC
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
 

Ch1

  • 1. Ali Abdi Jama DATA STRUCTURES & Algorithms Analysis USING Python 1
  • 3. Objectives: Introduction of Fundamental Concepts 3 Overview of Data Structures Overview of Algorithms Some Definitions Need of Data Structures Advantages of Data Structures Data Structure Classification Operations on data structure
  • 4. Overview of Data Structures 4 A data structure is a collection of data type ‘values’ which are stored and organized in such a way that it allows for efficient access and modification. In some cases a data structure can become the underlying implementation for a particular data. It plays a vital role in enhancing the performance of a software or a program as the main function of the software is to store and retrieve the user's data as fast as possible
  • 5. Overview of Data Structures  Data structure is representation of the logical relationship existing between individual elements of data.  In other words, a data structure is a way of organizing all data items that considers not only the elements stored but also their relationship to each other.  Program = Algorithm + Data Structure 5
  • 6. Overview of Algorithm  An algorithm is a set of instructions for solving a problem or accomplishing a task.  Algorithms are unambiguous specifications for performing calculation, data processing, automated reasoning, and other tasks. 6
  • 7. Categories Of Algorithm The major categories of algorithms are given below:  Sort: Algorithm developed for sorting the items in certain order.  Search: Algorithm developed for searching the items inside a data structure.  Delete: Algorithm developed for deleting the existing element from the data structure.  Insert: Algorithm developed for inserting an item inside a data structure.  Update: Algorithm developed for updating the existing element inside a data structure. 7
  • 8. Some Definitions  Database: Refers to all data that will be dealt with in particular situation. We’ll assume that each item in a database has a similar format. Example: A book using index cards,  Record: Records are the units into which a database is divided. Ex :each card represents a record 8
  • 9. Some Definitions  Fields: A record is usually divided into several fields. Fields hold a particular kind of data. Example a person’s name, address  Key: Search for a record within a database using specific key world. Eg search : name 9
  • 10. Need of Data Structures  As applications are getting complexed and amount of data is increasing day by day, there may arise the following problems:  Processor speed: To handle very large amount of data, high speed processing is required, but as the data is growing day by day to the billions of files per entity, processor may fail to deal with that much amount of data. 10
  • 11. Need of Data Structures  Data Search: Consider an inventory size of 106 items in a store, If our application needs to search for a particular item, it needs to traverse 106 items every time, results in slowing down the search process.  Multiple requests: If thousands of users are searching the data simultaneously on a web server, then there are the chances that a very large server can be failed during that process 11
  • 12. Need of Data Structures in order to solve the above problems, data structures are used. Data is organized to form a data structure in such a way that all items are not required to be searched and required data can be searched instantly. 12
  • 13. Advantages of Data Structures  Efficiency: Efficiency of a program depends upon the choice of data structures. For example: suppose, we have some data and we need to perform the search for a particular record. In that case, if we organize our data in an array, we will have to search sequentially element by element. hence, using array may not be very efficient here. There are better data structures which can make the search process efficient like binary search tree or hash tables. 13
  • 14. Advantages of Data Structures  Reusability: Data structures are reusable, i.e. once we have implemented a particular data structure, we can use it at any other place.  Abstraction: Data structure is specified by the ADT which provides a level of abstraction. The client program uses the data structure through interface only, without getting into the implementation details. 14
  • 15. Data Structure Classifications 15 Data structure Primitive DS Non-Primitive DS Integer Float Character Pointer Float Integer Float
  • 16. Data Structure Classifications 16 Non-Primitive DS Linear List Non-Linear List Array Link List Stack Queue Graph Trees
  • 17. Types Of Data Structure  A primitive data structure is generally a basic structure that is usually built into the language, such as an integer, a float.  A non-primitive data structure is built out of primitive data structures linked together in meaningful ways, such as a or a linked-list, binary search tree, AVL Tree, graph etc. 17
  • 18. Types Of Data Structure Linear Data Structures: A data structure is called linear if all of its elements are arranged in the linear order. In linear data structures, the elements are stored in non-hierarchical way. Types of Linear Data Structures are given below:  Arrays: An array is a collection of similar type of data items and each data item is called an element of the array. The data type of the element may be any valid data type like char, int, float or double. 18
  • 19. Types Of Data Structure  The elements of array share the same variable name but each one carries a different index number known as subscript. The array can be one dimensional, two dimensional or multidimensional. The individual elements of the array age are:  age[0], age[1], age[2], age[3],......... age[98], age[99]. 19
  • 20. Types Of Data Structure  Linked List: Linked list is a linear data structure which is used to maintain a list in the memory. It can be seen as the collection of nodes stored at non-contiguous memory locations. Each node of the list contains a pointer to its adjacent node. 20
  • 21. Types Of Data Structure  Stack: Stack is a data structure in which insertion and deletion operations are performed at one end only. – The insertion operation is referred to as ‘PUSH’ and deletion operation is referred to as ‘POP’ operation. – Stack is also called as Last in First out (LIFO) data structure. 21
  • 22. Types Of Data Structure  Queue: The data structure which permits the insertion at one end and Deletion at another end, known as Queue. – End at which deletion is occurs is known as FRONT end and another end at which insertion occurs is known as REAR end. – Queue is also called as First in First out (FIFO) data structure. 22
  • 23. Types Of Data Structure  Non Linear Data Structures: This data structure does not form a sequence i.e. each item or element is connected with two or more other items in a non- linear arrangement. The data elements are not arranged in sequential structure. 23
  • 24. Types Of Data Structure  Trees: Trees are multilevel data structures with a hierarchical relationship among its elements known as nodes. The bottom most nodes in the hierarchy are called leaf node while the top most node is called root node. Each node contains pointers to point adjacent nodes.  Tree data structure is based on the parent-child relationship among the nodes. Each node in the tree can have more than one children except the leaf nodes whereas each node can have at most one parent except the root node. 24
  • 25. Types Of Data Structure  Graphs: Graphs can be defined as the pictorial representation of the set of elements (represented by vertices) connected by the links known as edges. A graph is different from tree in the sense that a graph can have cycle while the tree can not have the one. 25
  • 26. Operations on data structure  Searching: The process of finding the location of an element within the data structure is called Searching. There are two algorithms to perform searching, Linear Search and Binary Search. We will discuss each one of them later . 26
  • 27. Operations on data structure  Insertion: Insertion can be defined as the process of adding the elements to the data structure at any location.  Deletion: The process of removing an element from the data structure is called Deletion. We can delete an element from the data structure at any random location. 27
  • 28. Operations on data structure  Searching: The process of finding the location of an element within the data structure is called Searching. There are two algorithms to perform searching, Linear Search and Binary Search. We will discuss each one of them later . 28
  • 29. Operations on data structure  Traversing: Every data structure contains the set of data elements. Traversing the data structure means visiting each element of the data structure in order to perform some specific operation like searching or sorting. 29
  • 30. Operations on data structure  Sorting: The process of arranging the data structure in a specific order is known as Sorting. There are many algorithms that can be used to perform sorting, for example, insertion sort, selection sort, bubble sort, etc.  Merging: When two lists List A and List B of size M and N respectively, of similar type of elements, clubbed or joined to produce the third list, List C of size (M+N), then this process is called merging 30