Professional Documents
Culture Documents
Types of Data Structure
Types of Data Structure
Types of Data Structure
Primitive data Structure are basic data Structure and are directly operated on
machine instructions. e.g. integer, characters.
Normally , primitive data Structure have different representation on different
computer.
A primitive data type defines how the data will be internally representation in
stored and retrieved from the memory.
Different types of primitive data Structure:-
1. integer
2. Float
3. Characters
4. Pointer
The non primitive data Structure are highly developed complex data
Structure.
non primitive Data Structure are derived from the primitive data structure.
Non primitive Data Structure emphasize on structure in a group
homogeneous (same type) or heterogeneous (different types)data items.
Different types of non primitive Data Structure:-
1. Linear data Structure
2. Non Linear data Structure
Linear data Structure
1)Array
An array is the collection of homogeneous (similar types) data element.
An array is declared by the following way in C language.
Int [10];
Diagram:-
2)Linked list
Linked list is the alternative approach of arrays .if we are not away of upper
limit of number of elements in advance than linked list is one of the options.
In this organisation data can be placed Anywhere is memory and these data
are linked with each other using pointer field.
This pointer field store the address of next element in the list.
Diagram :-
3)Stack
A stack is a data structure in which all the insertion and deletion are
performed at one end which is known as TOP of the stack.
Stack follow LIFO (last in first out) mechanism. The real life example of stack
are plates on tray and stack of coins etc.
Diagram:-
4)Queue
Graphs in data structures are non A queue is a linear data structure in which
insertion and deletion are Performed at rear and front respectively.
Queue follows FIFO (First in first out) mechanism.
The operations that can be performed on a queue are Insertion (add an
element in the front end of a queue) and Deletion (Deleting an element from
the rear end of a queue
Diagram:-
Non Linear data Structur
2.Graph
Graph is data Structure are non-linear data structures made up of a finite
number of nodes or vertices and the edges that connect them.
Graphs in data structures are used to address real-world problems in which it
represents the problem area as a network like telephone networks, circuit
networks, and social networks.
Graph is collection of vertices (nodes) and edges (arcs) where each edge in it
is specified by a pair of vertices. ĵ
Diagram
2.float
The float is a data type that can hold decimal values.
When the precision of decimal value increases then the Double data type is
used.
Syntex :- variable_name=val;
It can also assign multiple variables together by using a single float by
continuing them in the declaration statement.
3.character
The CHAR data type stores character data in a fixed-length fieldData can be a
string of single-byte or multibyte letters, numbers, and other characters that
are supported by the code set of your database