Data Structures
For
example, we can store a list of items having the same data-type using the array data structure.
In computer science, a data structure is a data organization, management, and storage format that enables efficient access and modification. More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data.
Primitive
and Non-primitive data structures
Primitive
Data Structures
Primitive
Data Structures are the basic data structures that directly operate upon
the machine instructions.
hey have different representations on different computers.
Integers, Floating point numbers, Character constants, String constants and Pointers come under
this category.
Non-primitive Data Structures
Non-primitive
data structures are more complicated data structures and are derived
from primitive data structures.They emphasize on grouping same or different data items with relationship between each data item.
Arrays, Lists and Files come under this
category.
Abstract Data Type in Data Structures
The Data Type is basically a type of data that can be used in
different computer program. It signifies the type like integer, float etc, the
space like integer will take 4-bytes, character will take 1-byte of space etc.
The abstract datatype is special kind of datatype, whose behavior
is defined by a set of values and set of operations. The keyword “Abstract” is
used as we can use these datatypes, we can perform different operations. But
how those operations are working that is totally hidden from the user. The ADT
is made of with primitive datatypes, but operation logics are hidden.
Some examples of ADT are Stack, Queue, List etc.
Let us see some operations of those mentioned ADT −
- Stack −
- isFull(), This is used to check whether stack is full
or not
- isEmpry(), This is used to check whether stack is
empty or not
- push(x), This is used to push x into the stack
- pop(), This is used to delete one element from top of
the stack
- peek(), This is used to get the top most element of the
stack
- size(), this function is used to get number of
elements present into the stack
- Queue −
- isFull(), This is used to check whether queue is full
or not
- isEmpry(), This is used to check whether queue is
empty or not
- insert(x), This is used to add x into the queue at the
rear end
- delete(), This is used to delete one element from the
front end of the queue
- size(), this function is used to get number of
elements present into the queue
- List −
- size(), this function is used to get number of
elements present into the list
- insert(x), this function is used to insert one element
into the list
- remove(x), this function is used to remove given
element from the list
- get(i), this function is used to get element at
position i
- replace(x, y), this function is used to replace x with
y value
Linear Data Structure AND Non-linear Data Structure
Linear
Data Structure:
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.
Difference between Linear and Non-linear Data Structures
Difference between Linear and
Non-linear Data Structures:
|
S.NO |
LINEAR DATA
STRUCTURE |
NON-LINEAR DATA
STRUCTURE |
|
1. |
In a linear data structure, data
elements are arranged in a linear order where each and every elements are
attached to its previous and next adjacent. |
In a non-linear data structure,
data elements are attached in hierarchically manner. |
|
2. |
In linear data structure, single
level is involved. |
Whereas in non-linear data
structure, multiple levels are involved. |
|
3. |
Its implementation is easy in
comparison to non-linear data structure. |
While its implementation is
complex in comparison to linear data structure. |
|
4. |
In linear data structure, data
elements can be traversed in a single run only. |
While in non-linear data
structure, data elements can’t be traversed in a single run only. |
|
5. |
In a linear data structure, memory
is not utilized in an efficient way. |
While in a non-linear data
structure, memory is utilized in an efficient way. |
|
6. |
Its examples are: array, stack,
queue, linked list, etc. |
While its examples are: trees and
graphs. |
|
7. |
Applications of linear data
structures are mainly in application software development. |
Applications of non-linear data
structures are in Artificial Intelligence and image processing. |



0 Comments