You are on page 1of 2

Data Structures

 A data structure, as the name suggests, stores and organize data according to specific
structure.
 Aim: To arrange data s.t. it can be accessed, processed and updated efficiently.
 Structure of the data storage varies from one to another, so does the functions.
 There are different basic and advanced types of data structures out there which we will
be going through.

Classification of Data Structures (Widely used)

 Primitive data structures: fundamental type of data structure that stores the data of
only one type.
 Non-Primitive data structures: types of data structure which is a user-defined that
stores the data of different types in a single entity.
 Linear data structures: Data structures in data elements are arranged sequentially or
linearly, where each element is attached to its previous and next adjacent elements, is
called a linear data structure.
 Non-linear data structures: Data structures where data elements are not placed
sequentially or linearly are called non-linear data structures. In a non-linear data
structure, we can’t traverse all the elements in a single run only.
 Static data structures: Static data structure has a fixed memory size. It is easier to
access the elements in a static data structure.
 Dynamic data structures: In dynamic data structure, the size is not fixed. It can be
randomly updated during the runtime which may be considered efficient concerning the
memory (space) complexity of the code.

Data Structures in python


 Lists
o ordered collections
o can be nested
o mutable
 Tuples
o Ordered collection
o Immutable
o Less memory, faster execution than lists
(Lists are slower than tuples because every time a new execution is done with lists, new objects are
created, and the objects are not interpreted just once. Tuples are identified by Python as one
immutable object. Hence, they are built as one single entity.)

 Sets
o Unordered collection
o Mutable
 Dictionaries
o Key value pairs
o mutable

You might also like