NTA UGC NET 2023 » NTA Study Materials » Computer Science » What is Data Structure?

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.

Data is a piece of useful information collected for processing and executing different tasks. Similarly, a data structure is a method of organising data for using it effectively in the future by a computer. It stacks up against similar data according to its type of structure. Different types of data structures have their own way of storing data. Data structure helps in easily getting information, as it is already classified as per the task. It makes both humans and machines retrieve necessary information quickly. It helps in simplifying the processing of data. Data structure is further classified into two groups, namely primitive data structure and non-primitive 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. 

Applications of Data Structures

  • Storing Data – With the help of data structures, one can easily organise and store data in such a way that it can be easily retrieved when needed. Different attributes are used to store them as per the relationship of the data with each other. 
  • Managing Data – When there is a large amount of data, it becomes difficult to manage all of it as per priorities. Data structure makes it easier to manage data as per users’ needs, however large the data might be. 
  • Searching – Data structures make it easier to search relevant information in a pile of data. The database has a required index and tree data types to be a guide through the database.
  • Scalability – Data structures help keep record of the performance of the data. Data storage can be maintained by data structures. 
  • Fast Processing – Data structures can boost the data processing speeds by providing the necessary data. It makes large amounts of data easier to work with. 
  • Reusable – Any data structure, once implied, can be used anywhere. The same structure can be implemented as many times as needed; there is no need to create similar structures. This saves time. 
  • Multiple users – It is common for thousands of users to handle a single database at a time. Data structures make this process easier. 

Conclusion

Data structures have made computing easier. Anyone can easily understand the necessity of having a data structure where the amount of data is ever increasing. The best example is social media, where millions of users use one application at a time. Data structures play an important role in handling and constantly managing such huge data. All the programming languages support different data types. By knowing different data structures, the user will be able to decide which one to use as the requirements of the data.

faq

Frequently asked questions

Get answers to the most common queries related to the NTA Examination Preparation.

What are the two main types of data structure?

Ans : The two main types of data structures are primitive data structures and non-primitive ...Read full

What are the types of primitive data structures?

Ans : String, byte, integer, boolean, character, and float ar...Read full

Which is the best data structure?

Ans : An array data structure is the best data structure as it is the simplest and most wide...Read full

What is an example of data structure?

Ans: Almost every aspect of the computer, operating system, artificial intelligence, compiler design, graphic...Read full