Week 1
Week 1
to
Data Structures
by
Amber Murtaza
Data Structure
• A data structure is a group of data elements that provides the
easiest way to store and perform different actions on the data
of the computer.
• A data structure is a particular way of organizing data in a
computer so that it can be used effectively.
• The idea is to reduce the space and time complexities of
different tasks.
• An efficient data structure also uses minimum memory space
and execution time to process the structure.
Data structures are used in various
fields such as:
• Operating system
• Graphics
• Computer Design
• Blockchain
• Genetics
• Image Processing
• Simulation etc.
Normally Data Structures are classified
into two main categories:
1. Primitive Data Structure
2. Non-primitive data Structure
Primitive Data Structure
• Primitive data structures are basic structures and are directly
operated upon by machine instructions.
• Primitive data structures have different representations on
different computers.
• Integers, floats, character and pointers are examples of
primitive data structures.
• These data types are available in most programming
languages as built in type.
Cont.
• These data types are available in most programming
languages as built in type.
o Integer: It is a data type which allows all values without
fraction part. We can use it for whole numbers.
o Float: It is a data type which use for storing fractional
numbers.
o Character: It is a data type which is used for character
values.
o Pointer: A variable that holds memory address of another
variable are called pointer.
Non primitive Data Type
• These are more sophisticated data structures.
• These are derived from primitive data structures.
• The non-primitive data structures emphasize on structuring of
a group of homogeneous or heterogeneous data items.
• Examples of Non-primitive data type are Array, List, and File
etc.
• A Non-primitive data type is further divided into Linear and
Non-Linear data structure
Cont.
o Array: An array is a fixed-size sequenced collection of
elements of the same data type.
Cont.
o List: An ordered set containing variable number of elements is
called as Lists.