I Love Everything That Makes Me More Human.
"Bad programmers worry about the code. Good programmers worry about data structures and their relationships." — Linus Torvalds
A Data Structure, as the name suggests, is a method to store data in a structured way so that it can be easily created, viewed, and managed.
Data Structures are generally classified into two classes:
Primitive Data Structures are the fundamental data types which are supported by programming language. They are created without the support of other data structure as a support or tool. Examples:
Between the two major classification of data structure, primitive data structure is less choose due to its inflexible nature.
Non-primitive Data Structures are created using primitive data structures. Non-primitive data structures are more complicated data structures and are derived from primitive data structures.These Data Structures can be designed by users. Examples:
Due to its flexible nature, between the two major classification of data structure, Non-primitive data structure is choosen more.
In a Linear Data Structure, the elements of Data Structure are stored in a linear or sequential order. Examples:
Stack is a linear data structure where the addition of new items and the removal of existing items always takes place at the same end. This end is commonly called as "top". As all the addition and removal in a stack is done from the "top" of the stack, the item added most recently will be removed first. Hence stack is called Last-In-First-Out(LIFO) data structure.
If the elements of a Data Structure are not stored in a sequential order, then it is a Non-Linear Data Structure. Examples: