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

Data Structure and Algorithm

The document provides an overview of data structures, categorizing them into primitive and non-primitive types. Primitive data structures include basic types like integers and pointers, while non-primitive structures such as arrays, files, and lists are derived from primitive types. It further details specific non-primitive structures like stacks, queues, graphs, and trees, highlighting their characteristics and functionalities.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Data Structure and Algorithm

The document provides an overview of data structures, categorizing them into primitive and non-primitive types. Primitive data structures include basic types like integers and pointers, while non-primitive structures such as arrays, files, and lists are derived from primitive types. It further details specific non-primitive structures like stacks, queues, graphs, and trees, highlighting their characteristics and functionalities.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

DATA STRUCTURES

& ALGORITHMS
PRIMITIVE DATA STRUCTURES
These are the structures which are supported at the
machine level, they can be used to make non-primitive
data structures. These are integral and are pure in form.
They have predefined behavior and specifications.
Examples: integer, float, character, pointers
The pointers, however don’t hold a data value, instead,
they hold memory addresses of the data values.
These are also called the reference data types.
NON-PRIMITIVE DATA
STRUCTURES
The non-primitive data structures cannot be
performed without the primitive data structures.
Although, they too are provided by the system itself yet
they are derived data structures and cannot be formed
without using the primitive data structures.
The Non-primitive data structures are further divided
into the following categories:
Arrays
Files
Lists
■ Linear Lists
■ Stacks
■ Queues)
■ Non-Linear Lists
■ Graphs
■ Trees
ARRAYS
Arrays are a homogeneous and contiguous collection
of same data types. They have a static memory
allocation technique, which means, if memory space is
allocated for once, it cannot be changed during runtime.
The arrays are used to implement vectors, matrices
and also other data structures. If we do not know the
memory to be allocated in advance then array can lead
to wastage of memory. Also, insertions and deletions are
complex in arrays since elements are stored in
consecutive memory allocations.
FILES
A file is a collection of records. The file data structure is
primarily used for managing large amounts of data which is
not in the primary storage of the system. The files help us to
process, manage, access and retrieve or basically work with
such data, easily.
LISTS
The lists support dynamic memory allocation. The
memory space allocated, can be changed at run time
also.

The lists are of two types:

A) LINEAR LISTS

The linear lists are those which have the elements


stored in a sequential order. The insertions and
deletions are easier in the lists.

They are divided into two types: Stacks and Queues


STACKS
The stack follows a “LIFO” technique for storing and
retrieving elements. The element which is stored at the
end will be the first one to be retrieved from the stack.
The stack has the following primary functions:
Push(): To insert an element in the stack.
Pop(): To remove an element from the stack.
QUEUES
The queues follow “FIFO” mechanism for storing and
retrieving elements. The elements which are stored first
into the queue will only be the first elements to be
removed out from the queue. The enqueue operation is
used to insert an element into the queue whereas the
dequeue operation is used to remove an element from
the queue.
B) NON LINEAR LISTS

The non linear lists do not have elements stored in a


certain manner.
These are:
GRAPHS
The Graph data structure is used to represent a
network. It comprises of vertices and edges (to connect
the vertices). The graphs are very useful when it
comes to study a network.
TREES
Tree data structure comprises of nodes connected in a
particular arrangement and they (particularly binary
trees) make search operations on the data items easy.
The tree data structures consists of a root node which is
further divided into various child nodes and so on. The
number of levels of the tree is also called height of the
tree.

You might also like