Data structures are divided into two parts - a)Linear Data Structure b) Non-Linear Data Structure.
Linear data structure:
------------------------- A linear data structure stores data in a sequential fashion.This facilitates in traversing(data accessing) / insertion / deletion of the data elements sequentially. This DS are contiguous either by their arrangement in successive memory locations or by means of pointers
Now, these linear DS can be represented in two ways in memory -
a) To have the linear relationship between the elements by means of sequential memory locations e.g. arrays.
b) To have the linear relationship between the elements represented by means of links. e.g. Linked Lists
Non-Linear data Structure:
---------------------------- In this case, the elements are stored in hierarchical manner (e.g. Traa) or in a dynamic random fashion (e.g. Graph).
Consider the TREE DS in which a tree has one node called as root node that is the root point that holds data and links to other nodes.
Elements in a nonlinear data structure do not form a sequence.It is because of this that we can traverse the elements in a non-linear DS in any way.
Hope this clears your question
--
Thanks & Regards,
RNA Team
Crniranjanraj, if this helps please login to Mark As Answer. | Alert Moderator