How many types of data structure in computer

Types of Data Structures

There are 2 types of data structure Primitive data structure And Non-Primitive data structure:

1. Primitive data structure

There are 4 types of Primitive data structure

  • Integer
  • Float
  • Character
  • Pointer
Non-primitive data structure

There are 2 types of Non-Primitive data structure

  • Linear data structures
  • Non-Linear data structures.

Classification of data structure


Primitive Data structure

Primitive data structures are primitive data types. Hey there are different representations on different computers.

Integers, character constants, floating point numbers, string constants, and pointers are into this categories. Int, float, double, char, and pointers are primitive data structures which can hold single values.

  • Primitive data structures are basic (Fundamental) data structures.
  • It can be operated directly on data and machine instructions.
  • It is also known as the basic data structure.
  • Some primitive data types are integers, reals, characters, floating point numbers, and pointer.
  • Primitive data structures are basic structures and are directly driven by machine instructions.
  • Primitive data structures have different representation on different computers system.
  • Integers, floats, characters, and symbols are examples of primitive data structures.
  • These data types are present in most of the programming languages as built in type.

Types Of Primitive Data Structure

primitive data structures are classified into these categories

Integer :
Integers are used to represent numerical data. Integers typically store whole numbers that can be positive and negative. The long range can be used in cases where the range of the integer data type is not large enough.
Float:
The float data type is used in languages to denote fractional numbers or numbers with decimal figures. The double can be used to increase the range and accuracy of the decimal type that floats the data type.
Character:
This is a data type that is used for character values.
Boolean :
Mostly, Boolean values are used for conditional testing.
Pointer:
A variable that holds a memory address of another variable is called pointer.

Non-Primitive Data structure

Non-primitive data structures is more difficult data structures and this is derived from primitive data structures. They emphasize grouping the same or different data items with a relation between each data item. Arrays, Lists and Files fall under this category.

  • Non-primitive data structures are data structures created using primitive data structures.
  • This is a bit complicated because it is derived from primitive data structures.
  • These are more sophisticated (Complex) data structures.
  • These are derived from primitive data structures.
  • Examples of non-primitive data types are array, list and file etc.

Types of Non-primitive data structures

Non-primitive data structures are classified only two (2) categories

  • Linear data structures
  • Non-Linear data structures.


Post a Comment

0 Comments