Difference Between
(1) Primitive and Non Primitive Data Structure
| Primitive Data Structure | Non Primitive Data Structure |
The Data Structure which is directly operated by machine level instruction is known as Primitive Data Structure. |
The Data Structure which is not directly operated by machine level instruction is known as Non Primitive Data Structure. |
| Example: Integer, Real, Character | Example: Array, Stack, Queue, Linked List, Tree |
(2) Linier and Non Linier Data Structure
| Linier Data Structure | Non Linier Data Structure |
The Data Structure in which elements are arranged such that we can process them in linier fashion (sequentially) is called linier data structure. |
The Data Structure in which elements are arranged such that we can not process them in linier fashion (sequentially) is called Non-Linier data structure. |
Example: Array, Stack, Queue, Linked List |
Example: Tree, Graph |
(3) Stack and Queue
| Stack | Queue |
A stack is a linier list in which insertion and deletion operations are performed at only one end of the list. |
Queue is a linier Data Structure in which insertion operation is performed at one end called Rear and deletion operation is performed at another end called front. |
Stack is also known as Last In First Out (LIFO). |
Queue is also known as First in First out (FIFO). |
It uses only one pointer called TOP. |
It uses two pointers called FRONT and REAR. |
Plate counter at Marriage Reception is an example of stack. |
Students standing in a line at fee counter is an example of queue. |
No wastage of memory. |
Wastage of Memory. |
(4) Queue and Circular Queue
| Queue | Circular Queue |
Queue is a linier Data Structure in which insertion operation is performed at one end called Rear and deletion operation is performed at another end called front. |
Circular Queue is a linier Data Structure in which elements are arranged such that first element in the queue follows the last element. |
The limitation of simple queue is that even if there is a free memory space available in the simple queue we can not use that free memory space to insert element. |
In Circular Queue we can utilize all available free memory space. |
Wastage of Memory space. |
No Wastage of Memory space. |
(5) Singly Linked List and Doubly Linked List
| Singly Linked List | Doubly Linked List |
In Singly Linked List each node consist of two parts: (1) Info (2)Link (Address of Next Node) |
In Doubly Linked List each node consist of three parts: (1) Info (2)LPTR (Left pointer contains address of previous node) (3) RPTR (Right Pointer contains address of next node) |
It occupies less memory as compared to doubly linked list. |
It occupies more memory as compared to singly linked list. |
Traversal is possible in only one direction (forward). |
Traversal is possible in both directions (forward as well as backward). |
(6) Internal Sort and External Sort
| Internal Sort | External Sort |
The sorting method that does not required external memory for sorting the elements is known as internal sort. |
The sorting method that required external memory for sorting the elements is known as external sort. |
It is useful when we have to sort fewer amounts of elements. |
It is useful when we have to sort large amount of elements. |
Example: Bubble Sort, Selection Sort, Insertion Sort, Quick Sort |
Example: Merge Sort, Radix Sort |
Widget is loading comments...