What is Data Structures ?

Data Structure is a way to store and organize data so that it can be used efficiently.

Data structures provide a means to manage large amounts of data efficiently for uses such as large databases and internet indexing services.
Usually, efficient data structures are key to designing efficient algorithms.

What do data structures do for us?

4 main Uses :

  • Insertion of data
  • Processing of data
  • Maintaining stored data
  • Retrieving of data

Insertion – more concerned with how the data will be added ? will it be added to the beginning , end, or somewhere in the middle.

Processing – It deals with how the data is being stored in the structure to accommodate new data or update, remove data from the structure.

Maintaining – Is focused on how the data is organized within the structure ? memory which needs to be allocated to accommodate this data.

Retrieval – To find and fetch the data which is stored in the data structure.

Next Important Thing !

Choosing the best data structure

Different data structures are better suited for different tasks. Choosing the wrong data structure can result in slow or unresponsive code (and mess up your application !), so it’s important to consider a few factors as you make your decision:

1. Identify the purpose – Whether you need it best for storage, search, faster data manipulation?, look for a data structure which suits better than any other.

2. Do you need more control over memory of the data structure? – Data structures that use static memory allocation (e.g: arrays or stacks) will manage memory for you and assume a fixed amount of memory upon instantiation with a cap on how much data may be added.
Data structures that utilize dynamic memory allocation (e.g: linked lists) allow you to allocate and reallocate memory within the life of the program.
This is something to keep in mind while you choose.

3. How fast is your data structure? – It may be possible that 2 data structures can do the same job, but thing here to note is how much time both took, one may be faster than another.
So choose wisely.

Summary

In this article, we answered what is data structure? what is the need or uses of data structures? and how do we choose the best suitable data structure?
Hope you liked it !


Leave a Comment