NTA UGC NET 2023 » NTA Study Materials » Computer Science » Fundamentals of the Data Structure

Fundamentals of the Data Structure

Data structure allows storing data while maintaining its robustness, reusability and adaptability in a computer program. It optimises the solution through low space-time complexity.

Data is an essential part of every day, and organising and storing it is the real deal. It is stored in various ways and formats. It can be either a single set of values or multiple values. A data item refers to a single set of values in general. For example, the name of an employee can be considered as one data item. It can further be categorised as subitems, namely first name, middle, and last name. The employee id associated with the data item would be a single item.

Further, the address can have sub-items such as street and area. Just one employee is likely to have numerous data items and subitems related to it. To store and maintain the robustness of data, the concept of data structure comes in. 

Data structure stores and organises a large set of data in computer memory. It ensures the reusability of data efficiently later. Data can be stored logically or mathematically. It can vary depending on the organisational needs and adaptability levels. The data models are adapted based on two factors:

  1. The structure was established to reflect the relation of data with real-world objects.
  2. Low level of complexity for reusability and robustness.

Types of data structures

In terms of relations

  • Linear data structures

In linear data structures, the elements form a specific order. The data might be allocated linear memory such as an array, or else the data might point to each other as in the case of a linked list.

Examples of linear data structures include arrays, linked lists, stacks and queues.

  • Non-linear data structures

The data structure represents the hierarchical relationship between elements.

Examples of non-linear data structure graphs, trees, heaps etc. 

In terms of size

  • Dynamic Data structures: The size of the data structure is variable and changes according to the data set. The memory is allocated at run-time for new items. It takes up only the required amount of space.
  • Static Data structures: The size of the data structure is fixed. The memory is allocated at compile time. 

Operations on Data Structures

The data is processed through a set of operations in both linear and non-linear data structures. The basic operations on data structures are listed below:

  1. Searching
  2. Sorting
  3. Insertion
  4. Traversing
  5. Merging
  6. Deletion

Characteristics of Data structures

  • Data structures can be homogeneous or nonhomogeneous. Homogenous has the same data types of elements represented in the data structure, for example, array. 

Non-homogenous might have different data types stored in the data structures.

  • It ensures the robustness of data is maintained
  • Data structure maximises the reusability of data
  • It reduces memory usage during processing
  • The execution time required for each process in the data structure is known as time complexity
  • The space required for each process in the data structure is known as space complexity

Advantages of Data Structures

  1. The right choice of data structure used in a particular problem increases its efficiency and optimises the solution for low space and time complexity.
  2. When a particular data structure is implemented in a program, it can be used again in some other part of the program, depending on its scope. This increases the reusability and robustness of the data.
  3. It abstracts the data on the various level and hence confines the interaction of data and user up to interface only.
  4. Data Structure simplifies the process of storing and processing data in software.

Popular data structures and their usage

  • Arrays: An array stores elements with the same data types in contiguous memory locations. Arrays can be one dimensional or two dimensional. It is a static and linear data structure. Arrays are generally used for operations like searching or sorting in a system. Every element inside an array has an index value attached to it. 
  • Linked list: Linked list contains nodes storing data and memory attached to it. The data is stored on a continuous memory location, and hence, the address stored in the node links it to the next address where the data is stored.
  • Stack: Stack is a linear data structure which allows insertion and deletion through the open end. The insertion operation is known as push, while deletion is called pop.
  • Queue: Another linear data structure where the operation follows FIFO( first in first out rule). Insertion in queues is known as enqueue, and deletion is known as dequeue.
  • Graph: A graph is a non-linear data structure with nodes and edges. It connects other nodes in the graph and forms a graphical image of an object. The graph can be a directed or undirected graph. Directed graphs are connected in a single direction, while undirected graphs are bidirectional.
  • Trees: Trees are non-linear data structures. It forms hierarchical relations with the data elements. The root node is the point from which the tree descends. A tree might have subtrees. It exhibits the parent-child relationship. The node that descends from a certain node is called a child node. A parent node can have multiple child nodes, but only one parent node.

 Conclusion 

Data structures allow systematic data storage for robustness and reusability. The correct implementation of data structure facilitates easy computing and manipulation of data as required. In software, there are thousands of programs running in the background, and each computer program utilises data structure to improve efficiency with space and time complexity.

faq

Frequently asked questions

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

What are the operations that can be performed on data structures?

Ans : Following operations can be performed on data structure...Read full

Which data structure to use for sorting numbers?

Ans : For sorting numbers, arrays can be used.

What is the application of data structures?

Ans : Data structures are used during programming. The applic...Read full

Are linked lists linear or non-linear data structures?

Ans: It can be considered both linear and nonlinear, depending on the application of the linked list in the p...Read full