Aditya Engineering College (A) : Python Data Structures
Aditya Engineering College (A) : Python Data Structures
By
• 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.
• 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.
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)