Why do we need data structures ?

                                                                                                            

Data structures

In computer science, a data structure is a data organization, management, and storage format that enables efficient access and modification.More precisely, a data structure is a collection of data values, the relationships among them, and the functions or operations that can be applied to the data.

Data Definition

Data Definition defines a particular data with the following characteristics.

  • Atomic − Definition should define a single concept.
  • Traceable − Definition should be able to be mapped to some data element.
  • Accurate − Definition should be unambiguous.
  • Clear and Concise − Definition should be understandable.

Data Object

Data Object represents an object having a data.

Basic Operations

The data in the data structures are processed by certain operations. The particular data structure chosen largely depends on the frequency of the operation that needs to be performed on the data structure.
  • Traversing
  • Searching
  • Insertion
  • Deletion
  • Sorting
  • Merging

Why do we need data structures ?

  • Data Structure can be defined as the collection of data objects which provides a way of storing and managing data in the computer so that it can be used.
  • Data Structures are the key part of many computer algorithms as they allow the programmers to do data management in an efficient way. A right selection of data structure can enhance the efficiency of computer program or algorithm in a better way.
With increasing complexities in computer algorithms, the amount of data usage is increasing, this can affect the performance of the application and can create some areas of concern.
  • Processing speed: To handle very large data, high-speed processing is required, but with growing data processor may fail to achive required processing speed.
  • Data Search: Getting a particular record from database should be quick and with optimum use of resources.
  • Multiple requests: To handle simultaneous requests from multiple users.
In order to work on concern areas, data structures are used. Data is organized to form a data structure in such a way that all items are not required to be searched and required data can be searched instantly.

Example
  • If you need to search your roll number in 20000 pages of PDF document (roll numbers are arranged in increasing order) how would you do that?
  • If you will try to search it randomly or in a sequential manner it will take too much time. You might get frustrated after some time.
  • You can try another solution which is given below…
  • Go to page no. 10000
  • If your roll no. is not there, but all other roll no. in that page are lesser than your than
  • Go to page no. 15000
  • Still if your roll no. is not there. but this time all other roll no. is greater than your.
  • Go to the page no. 12500
Continue the same process and within 30-40 seconds you will find your roll number. Congratulations… you just have used Binary Search algorithm unintentionally.
  • Algorithm is important in order to build up logic and data structure is important to use memory in effective way.
  • Data structure and algorithms help in understanding the nature of the problem at a deeper level and thereby a better understanding of the world.
Data structure's Usage

  • Data structures serve as the basis for abstract data types (ADT). The ADT defines the logical form of the data type. The data structure implements the physical form of the data type
  • relational databases commonly use B-tree indexes for data retrieval.while compiler implementations usually use hash tables to look up identifiers.
  •  efficient data structures are key to designing efficient algorithms.Data structures can be used to organize the storage and retrieval of information stored in both main memory and secondary memory                                                                                                                                                            
Example reference =   GeeksforGeeks