SlideShare a Scribd company logo
1 of 22
INTRODUCTION TO DATA
STRUCTURES
CS1301 DATA STRUCTURES
USING PYTHON
UNIT-1 LINEAR DATA
STRUCTURES
Basic Terminologies
zaid shabbir
Data Structure
Data: are simply a value are set of values of different
type which is called data types like string, integer, char
etc.
Structure: Way of organizing information, so that it is
easier to use
In simple words :
Its a way organizing data in such a way so that data can be
easier to use.
What is Data structure?
• It is a format for storing data in an organized
manner.
• A logical way of storing data and it also define
mechanism of retrieve data
• Abstract way to organize information.
Why do we need Data structures?
• Human requirement with computer are going to
complex day by day. To solve the complex
requirements in efficient way we need this study.
• It is a method/ technique for storing and organizing
the information in a computing machine.
• Since it is all organized and well maintained,
storage is properly taken care of and the data being
searched for can be retrieved very easily and f
• Generally classified as:
1. Primitive:- Primitive data types are
predefined types of data, which are supported
by the programming language. For example,
integer, character, and string are all primitive
data types.
2. Non Primitive :-Not defined by the
programming language, but are instead created
by the programmer.
Classification of Data structures
Operation on Linear/Non-Linear
Data Structure
●
●
●
●
●
Add an element
Delete an element
Traverse / Display
Sort the list of elements
Search for a data element
Types of Data Structure
Array:
• An array is defined as it is a collection of items
stored at contiguous memory locations.
• Arrays are the set of homogeneous data
elements stored in RAM, therefore, it can hold
only one type of data.
Pros: Fast Access
Memory consumption is minimal
Cons: Insertion and deletion is complicated
Types of Data Structure ...
Stack: A stack is a data structure in
which items can be inserted only from
one end and get items back from the
same end.
There , the last item inserted into
stack, is the the first item to be taken
out from the stack.
In short its also called Last in First
out [LIFO].
zaid shabbir
• Operations performed here:
Push :- add a element in stack
Pop :- remove an element in stack
• ADVANTAGES
1. Easy to started
2. Less Hardware
Requirement
3. Cross- Platform
• DIS ADVANTAGES
1. not flexible
2. Lack of scailability
Types of Data Structure ...
QUEUE: A queue is two ended
data structure in which items can
be inserted from one end and
taken out from other end.
Therefore , the first item inserted
into queue is the first item to be
taken out from the queue.
This property is called First in
First out [FIFO].
zaid shabbir
• Operations performed here:
Enqueue:- add a element in queue
Dequeue :- remove an element in queue
• Pros:
1. Being able to handle
multiple data types
2. Flexibility and fast.
• Cons:
1. A new element can only
be inserted when all of the
elements are deleted from
the queue.
Types of Data Structure ...
Linked List: In linked list space to store items is
created as is needed and destroyed when space no
longer required to store items.
It is a linear collection of data elements. It has two
parts:
1.Info :- gives information
2. other’s link part.- gives other node’s address
Hence linked list is a dynamic data structure.
• Operations performed in Linked list
Traversing
Searching
Insertion
Deletion
• Pros:
1. You can also decrease and increase
the linked list at run-time.
2. Memory is well utilized in the linked list. Because in it, we do not
have to allocate memory in advance.
3. Its access time is very fast, and it can be accessed at a certain
time without memory overhead.
• Cons
1. The linked list requires more memory to store the elements than
an array, because each node of the linked list points a pointer,
due to which it requires more memory.
2. It is very difficult to traverse the nodes in a linked list.
Types of Data Structure ...
• Tree: Non-linear data structure which is
mainly used to represent data containing a
hierarchical relationship between elements
• The data structure which
reflects this relationship is
called tree.
• Operations
1. Traversing
2. Searching
3. Insertion a
4. Deletion
• Pros:
1. It provides an efficient insertion and searching operations.
2. Trees are flexible.
• Cons:
1. A small change in the data can cause a large change in the
structure of the decision tree causing instability
2. It is relatively expensive as the complexity and time has
taken are more.
Types of Data Structure ...
Graph: Data sometimes contain a relationship
between pairs of elements which is not
necessarily hierarchical in nature.
For example, an airline flies only between cities
connected by lines.
It is a set of items connected by edges. Each
item is called a vertex or node.
• Trees are just like a special kinds of
graphs. Graphs are usually represented by
G = (V, E), where V is the set vertices and
E is the set of Edges.
• Operations Performed:
• Searching
• Insertion
• deletion
Types of Data Structure ...
Undirected Graph: A graph
whose edges are unordered
pair of vertices. That is each
edge connects two vertices.
In an undirected graph, direction
is not important, if the path is
available, it can be traversed in
any direction.
zaid shabbir
Types of Data Structure ...
Directed Graph: In directed graph a directional
edge connect two node/vertex. If there is one edge
from one vertex to other then only this path can be
followed.
Selecting a Data Structure
●
●
●
Analyze the problem to determine the resource
constraints a solution must meet.
Determine the basic operations that must be
supported. Quantify the resource constraints
for each operation.
Select the data structure that best meets these
requirements.

More Related Content

What's hot

What's hot (20)

L 15 ct1120
L 15 ct1120L 15 ct1120
L 15 ct1120
 
1.introduction to data_structures
1.introduction to data_structures1.introduction to data_structures
1.introduction to data_structures
 
Data struters
Data strutersData struters
Data struters
 
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)
 
Files and data storage
Files and data storageFiles and data storage
Files and data storage
 
Data structures
Data structuresData structures
Data structures
 
Types of datastructures
Types of datastructuresTypes of datastructures
Types of datastructures
 
Linear Data Structures - List, Stack and Queue
Linear Data Structures - List, Stack and QueueLinear Data Structures - List, Stack and Queue
Linear Data Structures - List, Stack and Queue
 
Trees
TreesTrees
Trees
 
Introduction to Data Structure part 1
Introduction to Data Structure part 1Introduction to Data Structure part 1
Introduction to Data Structure part 1
 
Data structure (basics)
Data structure (basics)Data structure (basics)
Data structure (basics)
 
Advanced Trees
Advanced TreesAdvanced Trees
Advanced Trees
 
Lecture 2 Data Structure Introduction
Lecture 2 Data Structure IntroductionLecture 2 Data Structure Introduction
Lecture 2 Data Structure Introduction
 
Data structures slideshare
Data structures slideshareData structures slideshare
Data structures slideshare
 
Data structure(Part 2)
Data structure(Part 2)Data structure(Part 2)
Data structure(Part 2)
 
Data structure unitfirst part1
Data structure unitfirst part1Data structure unitfirst part1
Data structure unitfirst part1
 
Dsa unit 1
Dsa unit 1Dsa unit 1
Dsa unit 1
 
Types OF Data Structures
Types OF Data Structures Types OF Data Structures
Types OF Data Structures
 
Data structures Lecture no.3
Data structures Lecture no.3Data structures Lecture no.3
Data structures Lecture no.3
 
Data structures Lecture no. 2
Data structures Lecture no. 2Data structures Lecture no. 2
Data structures Lecture no. 2
 

Similar to Unit 1 Basic concepts to DS

CHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptxCHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptx
OnkarModhave
 
1.Introduction to Data Structures and Algorithms.pptx
1.Introduction to Data Structures and Algorithms.pptx1.Introduction to Data Structures and Algorithms.pptx
1.Introduction to Data Structures and Algorithms.pptx
BlueSwede
 

Similar to Unit 1 Basic concepts to DS (20)

dsa.pptx
dsa.pptxdsa.pptx
dsa.pptx
 
lecture 02.2.ppt
lecture 02.2.pptlecture 02.2.ppt
lecture 02.2.ppt
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
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
 
DataStructurePpt.pptx
DataStructurePpt.pptxDataStructurePpt.pptx
DataStructurePpt.pptx
 
CHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptxCHAPTER-1- Introduction to data structure.pptx
CHAPTER-1- Introduction to data structure.pptx
 
DSA - Copy.pptx
DSA - Copy.pptxDSA - Copy.pptx
DSA - Copy.pptx
 
Data structure unitfirst part1
Data structure unitfirst part1Data structure unitfirst part1
Data structure unitfirst part1
 
1.Introduction to Data Structures and Algorithms.pptx
1.Introduction to Data Structures and Algorithms.pptx1.Introduction to Data Structures and Algorithms.pptx
1.Introduction to Data Structures and Algorithms.pptx
 
Classification of DS.pptx
Classification of DS.pptxClassification of DS.pptx
Classification of DS.pptx
 
Linked list
Linked listLinked list
Linked list
 
Learn Data Structures With Myassignmenthelp.Net
Learn Data Structures With Myassignmenthelp.NetLearn Data Structures With Myassignmenthelp.Net
Learn Data Structures With Myassignmenthelp.Net
 
Unit 1.ppt
Unit 1.pptUnit 1.ppt
Unit 1.ppt
 
ds bridge.pptx
ds bridge.pptxds bridge.pptx
ds bridge.pptx
 
PPT Format prashant .pptx
PPT Format prashant .pptxPPT Format prashant .pptx
PPT Format prashant .pptx
 
DataStructurePpt.pptx
DataStructurePpt.pptxDataStructurePpt.pptx
DataStructurePpt.pptx
 
Data Structure & Algorithm.pptx
Data Structure & Algorithm.pptxData Structure & Algorithm.pptx
Data Structure & Algorithm.pptx
 
Data structures - unit 1
Data structures - unit 1Data structures - unit 1
Data structures - unit 1
 
DS Module1 (1).pptx
DS Module1 (1).pptxDS Module1 (1).pptx
DS Module1 (1).pptx
 

More from LavanyaJ28 (16)

Cs1301 syllabus
Cs1301  syllabusCs1301  syllabus
Cs1301 syllabus
 
Ds important questions
Ds important questionsDs important questions
Ds important questions
 
2 marks- DS using python
2 marks- DS using python2 marks- DS using python
2 marks- DS using python
 
Searching,sorting
Searching,sortingSearching,sorting
Searching,sorting
 
Hashing
HashingHashing
Hashing
 
Graphs
GraphsGraphs
Graphs
 
Unit 3 trees
Unit 3   treesUnit 3   trees
Unit 3 trees
 
Heap types & Trees
Heap types & TreesHeap types & Trees
Heap types & Trees
 
Unit ii linear data structures
Unit ii linear data structures Unit ii linear data structures
Unit ii linear data structures
 
Unit ii linear data structures
Unit ii linear data structures Unit ii linear data structures
Unit ii linear data structures
 
Unit 2 application of stack
Unit 2  application of stack Unit 2  application of stack
Unit 2 application of stack
 
Stack and queue
Stack and queueStack and queue
Stack and queue
 
Unit 1 linked list
Unit 1 linked listUnit 1 linked list
Unit 1 linked list
 
Unit 1 array based implementation
Unit 1  array based implementationUnit 1  array based implementation
Unit 1 array based implementation
 
Unit 1 polynomial manipulation
Unit 1   polynomial manipulationUnit 1   polynomial manipulation
Unit 1 polynomial manipulation
 
Unit 1 abstract data types
Unit 1 abstract data typesUnit 1 abstract data types
Unit 1 abstract data types
 

Recently uploaded

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 

Unit 1 Basic concepts to DS

  • 1. INTRODUCTION TO DATA STRUCTURES CS1301 DATA STRUCTURES USING PYTHON UNIT-1 LINEAR DATA STRUCTURES
  • 2. Basic Terminologies zaid shabbir Data Structure Data: are simply a value are set of values of different type which is called data types like string, integer, char etc. Structure: Way of organizing information, so that it is easier to use In simple words : Its a way organizing data in such a way so that data can be easier to use.
  • 3. What is Data structure? • It is a format for storing data in an organized manner. • A logical way of storing data and it also define mechanism of retrieve data • Abstract way to organize information.
  • 4. Why do we need Data structures? • Human requirement with computer are going to complex day by day. To solve the complex requirements in efficient way we need this study. • It is a method/ technique for storing and organizing the information in a computing machine. • Since it is all organized and well maintained, storage is properly taken care of and the data being searched for can be retrieved very easily and f
  • 5. • Generally classified as: 1. Primitive:- Primitive data types are predefined types of data, which are supported by the programming language. For example, integer, character, and string are all primitive data types. 2. Non Primitive :-Not defined by the programming language, but are instead created by the programmer.
  • 7. Operation on Linear/Non-Linear Data Structure ● ● ● ● ● Add an element Delete an element Traverse / Display Sort the list of elements Search for a data element
  • 8. Types of Data Structure Array: • An array is defined as it is a collection of items stored at contiguous memory locations. • Arrays are the set of homogeneous data elements stored in RAM, therefore, it can hold only one type of data.
  • 9. Pros: Fast Access Memory consumption is minimal Cons: Insertion and deletion is complicated
  • 10. Types of Data Structure ... Stack: A stack is a data structure in which items can be inserted only from one end and get items back from the same end. There , the last item inserted into stack, is the the first item to be taken out from the stack. In short its also called Last in First out [LIFO]. zaid shabbir
  • 11. • Operations performed here: Push :- add a element in stack Pop :- remove an element in stack • ADVANTAGES 1. Easy to started 2. Less Hardware Requirement 3. Cross- Platform • DIS ADVANTAGES 1. not flexible 2. Lack of scailability
  • 12. Types of Data Structure ... QUEUE: A queue is two ended data structure in which items can be inserted from one end and taken out from other end. Therefore , the first item inserted into queue is the first item to be taken out from the queue. This property is called First in First out [FIFO]. zaid shabbir
  • 13. • Operations performed here: Enqueue:- add a element in queue Dequeue :- remove an element in queue • Pros: 1. Being able to handle multiple data types 2. Flexibility and fast. • Cons: 1. A new element can only be inserted when all of the elements are deleted from the queue.
  • 14. Types of Data Structure ... Linked List: In linked list space to store items is created as is needed and destroyed when space no longer required to store items. It is a linear collection of data elements. It has two parts: 1.Info :- gives information 2. other’s link part.- gives other node’s address Hence linked list is a dynamic data structure.
  • 15. • Operations performed in Linked list Traversing Searching Insertion Deletion • Pros: 1. You can also decrease and increase the linked list at run-time. 2. Memory is well utilized in the linked list. Because in it, we do not have to allocate memory in advance. 3. Its access time is very fast, and it can be accessed at a certain time without memory overhead. • Cons 1. The linked list requires more memory to store the elements than an array, because each node of the linked list points a pointer, due to which it requires more memory. 2. It is very difficult to traverse the nodes in a linked list.
  • 16. Types of Data Structure ... • Tree: Non-linear data structure which is mainly used to represent data containing a hierarchical relationship between elements • The data structure which reflects this relationship is called tree.
  • 17. • Operations 1. Traversing 2. Searching 3. Insertion a 4. Deletion • Pros: 1. It provides an efficient insertion and searching operations. 2. Trees are flexible. • Cons: 1. A small change in the data can cause a large change in the structure of the decision tree causing instability 2. It is relatively expensive as the complexity and time has taken are more.
  • 18. Types of Data Structure ... Graph: Data sometimes contain a relationship between pairs of elements which is not necessarily hierarchical in nature. For example, an airline flies only between cities connected by lines. It is a set of items connected by edges. Each item is called a vertex or node.
  • 19. • Trees are just like a special kinds of graphs. Graphs are usually represented by G = (V, E), where V is the set vertices and E is the set of Edges. • Operations Performed: • Searching • Insertion • deletion
  • 20. Types of Data Structure ... Undirected Graph: A graph whose edges are unordered pair of vertices. That is each edge connects two vertices. In an undirected graph, direction is not important, if the path is available, it can be traversed in any direction. zaid shabbir
  • 21. Types of Data Structure ... Directed Graph: In directed graph a directional edge connect two node/vertex. If there is one edge from one vertex to other then only this path can be followed.
  • 22. Selecting a Data Structure ● ● ● Analyze the problem to determine the resource constraints a solution must meet. Determine the basic operations that must be supported. Quantify the resource constraints for each operation. Select the data structure that best meets these requirements.