Tuesday, October 29, 2013

Data Structures: How it Works

data structure
Think about some of the furniture that we have in our living premises. The cabinets in the kitchen store cups and plates, the closet in our rooms stores clothing, and the garage, if you have one, stores vehicles. We put the objects we have into those different compartments because it is easy for us to organize and access them to get what we need. Like a computer, there ways to store and access data that allow us to do what we need to do. These storage are called data structures, which is a way of storing and organizing data in a computer so that it can be used efficiently.

Each data structure helps the programmer handle large amounts of data and structure them in a manageable way. Common uses of data structures, for example, are searching and sorting. Searching allows us to find the data we need in a structure and sorting allows us to organize the data. Having data structures can sometimes allows us to do less work. Some data structures include arrays, linked lists, and binary trees. They all have their own advantages and disadvantages: arrays are good for searching, but not adding data, linked lists are good for adding, but not searching data, and binary trees are good for both searching and adding data.

data memory
Basically, each data structures have their own sets of operations that are performed to access and change data. It is important to have knowledge of different data structures so we know which will be the most advantageous in our programs. Like our household furniture, it would be inconvenient to put our clothing inside kitchen cabinets and plates inside closets.

1 comment:

  1. Great analogies and metaphors for data structures. I think one of the problems with learning computer science is being able to put into words some fairly abstract ideas and you do it perfectly here. I think teachers need to be aware of the simple metaphors they can tell their students to help them understand the concepts. For example, a teacher who is teaching Java can use these metaphors to describe data structures then inform students that storage is only half the use of these objects. If I have a box that I can put stuff into that's a data structure, but the method I place things in and out of that structure is the algorithm. Simple connections like the one you have and the one I just stated can be really helpful to get programming to click in someones head. Awesome post, keep up the interesting material.

    ReplyDelete