Can
you imagine what would happen to our bedroom if we do not have closest or
storage? Our cloths would be all over our bedroom. Speaking from an experience,
finding important things in an unorganized room will be a great challenge, and
one would be spending their valuable time on something useless. Similar logic
applies to programming. Data structures in programming work as a closet or storage
to store and retrieve data efficiently.
Why should you
care about Data Structures?
Now,
you might be wondering “why should you care about data structures?” Answer to
this question might be different depending on your interests. If you are not
planning to learn programming, then you may never have to learn various data structures.
However, if you want to be an excellent programmer or pursue a career in
Computer Science (because you are awesome!), then you must have to learn
different data structures.
| Examples of different data structures |
Importance of
Data Structures
Data
structures’ most important features are efficiently storing, searching,
retrieving and traversing the data. Attributes of data structures make them
very useful and an essential tool in programming. According to one my Computer
Science professor, “data structures serves as a heart of every application.”
For instance, if you are building GUI applications and following MVC patterns, then you need to figure out which data
structure will you use for your model. In addition, almost all algorithms rely
on the correct choice of data structures to get the best running time. For
instance, if you run some specific algorithm and change the underlying data
structure of the algorithm, then you may find that algorithms running time
drastically increases. Lastly, use of data structures in programming make codes
very readable.
How to learn
Data Structures?
Since
data structures are very essential tools for programming, most of the
well-known companies tend to ask interview questions based on data structures.
Often interviewee tends to stumble upon those questions, and loses their dream
jobs. So, what is the best practice to learn data structures? According to
Robert Love, Software Engineer and interviewer at Google, one should visualize
the data structures. He recommends “Intuitively understand what the data
structure looks like, what it feels like to use it, and how it is structured
both in the abstract and physically in your computer’s memory.” Another
important thing to focus on while studying data structures is to understand
when to use that particular data structure. The reason behind that is every
data structures is designed to achieve certain things efficiently, but that
same data structure would be very inefficient at achieving other tasks. For
instance, arrays, the most basic data structure, are good for retrieving data
at given location (it takes O(1)), but arrays running time drastically
increases for removing data from the middle of the array.
I
hope you enjoyed my post about data structures and learned something new from
this post. I am looking forward to hear your suggestions in comments.
References:
http://s.radar.oreilly.com/wp-files/5/2013/03/redis-data-structures.png


