# What is the Classification of Data Structure with Diagram

Classification of Data Structure, Data Structures are normally divided into two broad categories:

**(1)** Primitive Data Structures

**(2)** Non-Primitive Data Structures

## What is Primitive Data Structures?

These are basic structures and are directly operated upon by the machine instructions.

These to general have different representations on different computers, Integer, Floating point numbers, character-constants, string constants, pointers, etc.

### Example of Primitive Data Structures with explanation

- Float
- Integer
- Character
- Pointer

__What is Float?__

Float: When you listen to float in the data structure, the first thing which comes in mind, what is mean of float? if you don’t know, let’s explain me, Float is a tern in a data structure which is used in the various programming language, for defining the variable with a fractional value.

this is the contrast of the integer data type, therefore, the numbers created using of float variable declaration will have decimal point, which means have to digit on both sides of a decimal point. In other words, we can say that programmers used float term before the name of a variable.

as a result, declare a value for the float variable by using the name of variables, after that adding the equal sign, and follows as according to the value.

__What is an Integer?__

An integer defined as a whole number, not a fraction number, the integer number can be positive, negative or zero number. such as 10, 11, 0, -7, -67 and 5148 are all integers. integer number can’t have decimal places.

therefore, when two integer numbers are added, subtracted or multiplied, the result always comes as an integer.

__What is Character?__

Character in the data structure represents letter and symbol such as a, B, f, R, “.” , “-” and whitespace. therefore, it can store the basic character set. it can hold one letter/symbol like n, F,d, etc. characters can also be of different types.

__What is Pointer?__

A pointer represents a storage location in memory (RAM).in the RAM contains many cells and the values are stored in these cells. each cell in memory is 1 byte and the memory address is always an unsigned integer, therefore, each cell has a unique address to identify it.

## What is Non-Primitive Data Structures?

Generally, language provides a way of defining our own data type. such data types are kept under the **non-primitive data** structure category.

therefore, these are the more sophisticated data structure. These are derived from the primitive data structure.

The non-primitive data structures emphasize the structuring of a group of **homogeneous or heterogeneous** data items.

**therefore, Arrays, lists, and files are the example.**

consequently, we can define, the design of an efficient data structure must take operations to be performed on the data structure into account.

furthermore, let’s see the example, consider a data structure consisting of a set of data items.

The data structure is to be manipulated to a number of major program functions.

finally, when evaluating the operations to be performed on the data structure here, an abstract data type is defined to use it in subsequent programs.

### Example of Primitive Data Structures with explanation

- Arrays
- Lists
- Files
- Stacks
- Queues
- Graphs
- trees

__What is Arrays?__

An array is defined as it is a collection of items stored at contiguous memory locations. we can also say that arrays are the set of homogeneous data elements stored in RAM, therefore, it can hold only one type of data.

Therefore, the data may be all floating numbers or all characters or all integers numbers. therefore, array makes it easier to calculate, what is the position of each element by simply adding an offset to a base value.

Therefore, Single sub-scripted values are called linear array or one-dimensional array and two-subscripted variables are called as two-dimensional array.let’s understand better as given below diagram. read more

__What are Lists?__

A Lists is defined as it is a collection pf a variable number of data items. lists or sequence is an abstract data type, which always represents a countable number of ordered values, Every list element contains at least two fields, one field is used for storing the data and another filed is used for storing the address of the next element.

therefore we can say that lists are an example of containers. as they contain other values. if the same value occurs multiple times, then each occurrence is considered a distinct item.

#### Diagram:

__What is Files?__

Files contain information, and this information stored permanently in the Hard Disk and Floppy Disk, this disk also knows as a secondary storage device. you can store a little byte of data and a large amount of data in secondary devices.

therefore, A file name always contains the primary and secondary name and dot(.) is used for separating. for understanding in a better way see the below Diagram

__What is Stacks?__

A stack is a basic data structure, it’s defined as an ordered collection of elements represented by a real physical stack or pile. liner data structure features insertion and deletion of items take place at one end called top of the stack.

Therefore, In these structure data set as a stack of books or plates, in the stack, you can remove the item from the top order. you can use these concepts or structures all throughout programming. the implementation of the stack also know as LIFO (Last in First Out)

these are the three basic concepts that can be performed on stacks.

1) push (insert the items into a stack)

2) Pop (delete an item from the stack)

3) Pip (displaying the content of the stack)

#### Diagram:

__What are Queues?__

Queue defined (FIFO) First In First Out type of data structure. Queues are also the part of non-primitive linear data structure, therefore in Queues process, we can insert an element in a queue from the REAR end and delete an element from the FRONT end only.

**Therefore, Implement queues with using two ways: **

- Pointers
- Arrays

__What are the Graphs?__

**There are different types of graphs :**

- Connected Graph
- Non-Connected Graph
- Directed Graph
- Non-Directed Graph

therefore, graphs are the non-linear and non-primitive type of data structure. graph is representing the different types of physical design structures such as used in Chemistry, physics, maths & Engineering Science.

__What are the trees?__

In the classification of data structure, Trees also come in the non-primitive and non-linear category data structure, using tree we can represent a hierarchical relationship between the data elements.

## Data Structure the most commonly used operations

As a result, in the Classification of Data Structure, Data Structure the most commonly used operations are broadly categorized into four types:

**(1) Create**

**(2) Delete**

**(3) Selection**

**(4) Update**

**CREATE operation**

The **CREATE operation** (it can be defined) results in reserving memory for the program elements.

This can be done by a declaration statement.

The creation of data structure may take place either during compile -time or during Runtime.

**DELETE operation**

therefore, on the other hand, **DELETE operation** destroys the memory space allocated for the specified data structure Malloc() and free ()

as a result, the function of C language is used for these two operations respectively.

### The **SELECTION operation**

The **SELECTION operation** can be defined as its deals with accessing particular data within a data structure.

And the last operations **UPDATE**, as the name implies, it updates or modifies the data in the data structure.

hence, in the Classification of Data Structure the operation Probably new data may be entered or previously stored data may be deleted.

so, in Classification of Data Structure, Other operations performed on data structure include:

**(1) Searching**

**(2) Sorting**

**(3) Merging**

**Searching operation** finds the presence of the desired data item in the list of the data item.

it can define that **Sorting** is the process of arranging all data items in a data structure in a particular order say for example, either in ascending order or in descending order.

furthermore, finally **MERGING** is a process of combining the data items of two different sorted lists into a single sorted list.