Submitted by admin on
datastructure

 

Primitive Data Structure


Primitive data structures are the fundamental data structures means Every programming  language has  built-in such Data Structure.

Primitive Data Structures are the basic data structures that directly operate upon the machine instructions.

in general, there are 8 data types

  1. boolean data type
  2. byte data type
  3. char data type
  4. short data type
  5. int data type
  6. long data type
  7. float data type
  8. double data type

Type of data structure that stores the data of only one type.

Examples:  integer, float, realboolean, character, pointer.

Non-Primitive data Structure

Non-primitive data structures are user defined data structure that are created using the primitive data structures.

Type of data structure that can store the data of more than one type ie. grouping of same or different data items.

Examples :  Array, Linked List, Stack, Queue, Binary Tree, Binary Search Tree, Heap, Hashing, Graph, Matrix.

Non-primitive data structures are classified into two categories

  1.  Linear data structures
  2.  Non-Linear data structures.


1). Linear data structures


If the elements are stored in a linear or sequential order of a data structure, then it is known as a linear data structure.

Examples :  Array, Linked List, Stack, Queue.


In memory, Linear data structures can be represented in two different ways.
In the first way, the linear relationship between the elements is because of sequentially memory locations where items are stored. For example an array take memory in sequential fashion.
And in the second way, elements have a linear relationship because of the link. For example node of the linked list are linked together because its node are arrange in memory in non-sequential fashion.

2). Non-linear data structures

In Non-linear data structures, elements are not stored in sequential order.

Examples :  Binary Tree, Binary Search Tree, Heap, Hashing, Graph, Matrix.

Array
Linked List
Stack
Queue
Binary Tree
Binary Search Tree
Heap
Hashing
Graph
Matrix