Saturday, November 2, 2013

Data Structures: What to know about them


All of you must have asked this question to yourself in college ( at least for the Computer Science students while studying Data Structures ), "Will I really use all of these in my professional life" or "Where will I actually use them". And the answer to this becomes clear as we are more involved in developing projects/applications where in the computation time (i.e. time required for the completion of some task ) is much more important than anything else. You do not want to be waiting all-day long for a certain result to be shown to you until you proceed further. 

Well, this is where the expertise about data structures and algorithm comes in picture. Data Structure is an integral part of any computer science problem. It specifies a way of storing and organizing data in a computer memory so that it can be used efficiently. With this in mind; we have different requirements for different applications. In some applications we need data retrieval to be fast as compared to storing, but in others we would need data to be stored in sorted order and everytime we retrieve the smallest of them. This way, depending on the requirement of the application/problem in hand, we need to select the data structure accordingly.

Different data structures have different approaches to storing data and retrieving it from the memory. Some algorithms store data faster than retrieval like, Linkedlist, whereas for other it's the opposite. Data Structures have time and space complexities associated which estimates the amount of time it will take to do the required operation. Because, you cannot deploy your application and then check for how much time it takes. For these, mathematical expressions such as Fourier and discrete transform along with various other mathematical expressions are used to estimate such things.  


Well, there are loads of data structures to use from, when solving a problem, ranging from heaps, hash tables, trees, linked list, Queues, etc. To get the complete list of data structures you can see this wiki.
When writing about this blog-post, I thought to write about a data structure I came across recently, called Trie which is widely used in most applications and many of us are not even aware of it.


Trie is used in most of the application we use in our daily life.

It is used in search engines for storing the occurrence of the word in a particular URL, used in routers to match an IP address in a routing table. 
It has many advantages over other data structures in terms of searching, inserting and deleting, all of which can be found here 


It is a fairly simple data structure to understand but is used in all complex applications and yet most of us are not aware of it. I would highly recommend watching this video from IIT-Delhi. The concepts and all the problems of it are explained with solutions and reasoning. Also, this link has some good implementation details if you guys are interested in.
Well ,be it for technical interviews or problem solving my best bet would be to at least know what this data structure does.





No comments:

Post a Comment