2. Data Structure
What is Data Structure?
Organizing, managing and storing data is important as it enables easier
access and efficient modifications. Data Structures allows you to organize
your data in such a way that enables you to store collections of data, relate
them and perform operations on them accordingly.
Philosophy
“Clever” ways to organize information in order to enable efficient
computation
3. Goals
what the tools are for storing and processing common data
types
which tools are appropriate for which need
So that make good design choices as a programmer
Another Goal is it must be rich in structure to reflect the actual relationship
of data in real world .The structure should be simple enough for efficient
processing of data .
6. Built-in Data Structure
Understand Data
Understand the data according to its Nature.
Map the data with available structure.
choosing the right data structure for your data
7. Three W’s
Why we are using data?
What we are going to do with the data?
Where we are sending data i.e location or container?
8. Python’s Data structure
Data Structure
Built-in Data
Structure
List Tuples
User Defined
Data Structure
Dictionary Set
Hash Map
Graph
Linked List
Tree
Stack
Queue
10. Lists
This Data structure use for storing and accesing objects which belongs in
a specific sequence.
Lists are used to store multiple items in a single variable
Lists in Python are linear containers used for storing data of various Data
Types. The ability to store a variety of data is what makes Lists a very
unique and vital Data Structure in Python.
11. Examples
city_list=['Newyork','chicago', 'Los Angeles', 'Houston', 'Philadelphia',
'Dallas']
squares = [‘1’, ‘4, 9’, ’16’]
List with Mixed Data types
My_list = [‘1’ ,”Hello”, ‘3.5’]
14. Features of Lists
Lists are ordered.
Lists can contain any arbitrary objects.
List elements can be accessed by index.
Lists are mutable.
Lists are dynamic.