Selecting a Data Structure |
|
|
|||
How can we select the data structure
needed to solve a problem? You have already studied where to use array and
the size of array and when and where to use the pointers etc. First of all, we
have to analyze the problem to determine the resource constraints that a
solution must meet. Suppose, the data is so huge i.e. in Gega bytes (GBs)
while the disc space available with us is just 200 Mega bytes. This problem
can not be solved with programming. Rather, we will have to buy a new disk. Secondly, it is necessary to
determine the basic operations that must be supported. Quantify the resource
constraints for each operation. What does it mean? Suppose you have to insert
the data in the computer or database and have to search some data item. Let’s
take the example of telephone directory. Suppose there are eight million
names in the directory. Now someone asks you about the name of some
particular person. You want that this query should be answered as soon as
possible. You may add or delete some data. It will be advisable to consider
all these operations when you select some data structure. Finally select the data structure
that meets these requirements the maximum. Without, sufficient experience, it
will be difficult to determine which one is the best data structure. We can
get the help from internet, books or from someone whom you know for already
getting the problems solved. We may find a similar example and try to use it.
After this course, you will be familiar with the data structures and
algorithms that are used to solve the computer problems. |
|||||
|
BACK |
HOME |
NEXT |
||