KEMBAR78
Data Structure | PDF | Data Type | Queue (Abstract Data Type)
0% found this document useful (0 votes)
13 views2 pages

Data Structure

Data structures are organized ways of storing data, classified into primitive and non-primitive types. Primitive data structures include types like integer, float, boolean, and char, while non-primitive structures can hold multiple data types and are divided into linear (e.g., arrays, stacks, queues) and non-linear (e.g., trees, graphs) categories. Each type serves different purposes and has specific characteristics for data management.

Uploaded by

nehakashyap20298
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Data Structure

Data structures are organized ways of storing data, classified into primitive and non-primitive types. Primitive data structures include types like integer, float, boolean, and char, while non-primitive structures can hold multiple data types and are divided into linear (e.g., arrays, stacks, queues) and non-linear (e.g., trees, graphs) categories. Each type serves different purposes and has specific characteristics for data management.

Uploaded by

nehakashyap20298
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

What is Data Structure?

Data structure is putting together data in an organised manner. Data is arranged as primitive data
structure, non-primitive data structure, and linear data structure.

Classification of Data Structures

Primitive Data Structure –


Primitive data structure stores data only in one type in a specific location. It does not store null data.
It will always contain a certain value. It always starts with a lowercase character. The primitive data
structure has eight data types: integer, float, boolean, and character. The data types used can differ
based on different programming languages.
• Integer – This type of data holds numerical values. It consists of whole numbers that can be
either negative or positive. If the range of integer data type is small, we can use long. It
holds mathematical integers. It provides 4 bytes of size for storing integer data.
• Float – This type can hold data that has decimal values. It can hold precise values. It has the
precision to hold up to 17 significant digits. It can hold numbers that are not integers. They
can be stored in 4 – 8 bytes of sizes.
• Boolean – This type of data can hold true or false values. It helps check the condition if one
among the two possible values is correct as per logic.
• Char – This type of data can hold both lowercase and uppercase of a single alphabet. It
stores character data of a fixed-length field. Apart from alphabets, it stores symbols and
digits.

Non-primitive Data Structure –


The non-primitive data structure can hold many values that have random or contiguous locations. It
can store more than one type of data. It can consist of a null value, unlike a primitive data structure.
It always starts with an uppercase character. The size of the non-primitive data structure is further
divided into two types: linear data structure and non-linear data structure.
• Linear Data Structure –
The linear data structure has data that is stored in a sequence. It follows by organising one data after
another. One data is linked to the data in front and behind it. While accessing linear data, we can
start from one place till we find another data in the sequence, as data is connected to each other. It
follows a trend in the arrangement. The linear data structure has the following data types;
• Array – This data type can store a single type of data; it cannot hold a combination of data,
e.g. it cannot hold a combination of integers and characters. It is commonly used for
searching, insertion, traversing, and deletion.
• String – It is defined as an array or sequence of characters/ text. It ends with ‘\0’.
• Stack – This data type uses the LIFO – Last In First Out principle. The operations in the
stack data structure are performed from the top. The insertion of an element into the stack
data type is known as the PUSH operation while the removal of an element is known as the
POP operation.
• Queue – It is different from stack data type as elements are added from the rear end (en
queue) and are removed from the front end (de queue). It is open at both ends. It follows the
First In First Out (FIFO) principle.
• Non-linear Data Structure –
A non-linear data structure does not have data arranged in a particular sequence. It does not have a
particular level; thus users can see all the data in a single run. Each element is a non-linear data
structure that can have multiple ways of connecting to other elements. The non-linear data structure
has the following data types:
• Trees – It exclusively represents hierarchical data. It arranges data on multiple levels. Here
data can be of any type. Its complexity increases with large data volumes.
• Graphs – It shows the relationship between different data with nodes and edges. It is a
pictorial representation of links between different data.

You might also like