0% found this document useful (0 votes)
139 views

Aditya Engineering College (A) : Python Data Structures

The document discusses different types of data structures in Python. It describes stacks, which follow the LIFO principle, and queues, which follow the FIFO principle. It also distinguishes between linear data structures like arrays, stacks, and queues, where elements are arranged sequentially, and non-linear structures like trees and graphs, which have multiple levels and can't be traversed in a single run.

Uploaded by

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

Aditya Engineering College (A) : Python Data Structures

The document discusses different types of data structures in Python. It describes stacks, which follow the LIFO principle, and queues, which follow the FIFO principle. It also distinguishes between linear data structures like arrays, stacks, and queues, where elements are arranged sequentially, and non-linear structures like trees and graphs, which have multiple levels and can't be traversed in a single run.

Uploaded by

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

ADITYA ENGINEERING COLLEGE (A)

PYTHON DATA STRUCTURES


https://www.edureka.co/blog/data-structures-in-python/#queue

By

Mr. B. Vinay Kumar


Dept of Information Technology
Aditya Engineering College(A)
Surampalem.
Data Structures Aditya Engineering College (A)

• 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. 
• Python has implicit support for Data Structures which enable you to
store and access data. These structures are called List, Dictionary, Tuple
 and Set.
• Python allows its users to create their own Data Structures enabling
them to have full control over their functionality. The most prominent
Data Structures are Stack, Queue, Tree, Linked List and so on which are
also available to you in other programming languages.
Python Programming Mr. B. Vinay Kumar 7/3/20
Types of Data Structures in Python Aditya Engineering College (A)

Python Programming Mr. B. Vinay Kumar 7/3/20


Stack Aditya Engineering College (A)

• Stacks are linear Data Structures which are based on the principle of Last-In-
First-Out (LIFO) where data which is entered last will be the first to get accessed.
• It is built using the array structure and has operations namely, pushing (adding)
elements, popping (deleting) elements and accessing elements only from one
point in the stack called as the TOP.
• This TOP is the pointer to the current position of the stack. Stacks are
prominently used in applications such as Recursive Programming, reversing
words, undo mechanisms in word editors and so forth.

Python Programming Mr. B. Vinay Kumar 7/3/20


Queue Aditya Engineering College (A)

• A queue is also a linear data structure which is based on the principle of First-In-
First-Out (FIFO) where the data entered first will be accessed first.
• It is built using the array structure and has operations which can be performed
from both ends of the Queue, that is, head-tail or front-back.
• Operations such as adding and deleting elements are called En-Queue and De-
Queue and accessing the elements can be performed.
• Queues are used as Network Buffers for traffic congestion management, used in
Operating Systems for Job Scheduling and many more.

Python Programming Mr. B. Vinay Kumar 7/3/20


Aditya Engineering College (A)

• Linear Data Structure:

Data structure where data elements are arranged sequentially or linearly where the
elements are attached to its previous and next adjacent in what is called a linear data
structure. In linear data structure, single level is involved. Therefore, we can traverse all the
elements in single run only. Linear data structures are easy to implement because
computer memory is arranged in a linear way. Its examples are array, stack, queue, 
linked list, etc.
• Non-linear Data Structure:

Data structures where data elements are not arranged sequentially or linearly are
called non-linear data structures. In a non-linear data structure, single level is not involved.
Therefore, we can’t traverse all the elements in single run only. Non-linear data structures
are not easy to implement in comparison to linear data structure. It utilizes computer
memory efficiently in comparison to a linear data structure. Its examples are trees and 
graphs.
Python Programming Mr. B. Vinay Kumar 7/3/20
Aditya Engineering College (A)

Python Programming Mr. B. Vinay Kumar 7/3/20

You might also like