Welcome To baselogics.blogspot.in

Jasper Roberts - Blog

Wednesday, September 10, 2014

Data Structures and Programming

In algorithmic problem solving, we deal with objects.  Objects are data manipulated by the algorithm.  To a cook, the objects are the various types of vegetables, meat and sauce.  In algorithms, the data are numbers, words, lists, files, and so on.  In solving a geometry problem, the data can be the length of a rectangle, the area of a circle, etc.  Algorithm provides the logic; data provide the values.  They go hand in hand.  Hence, we have this great truth:
Program = Algorithm + Data Structures
 Data structures refer to the types of data used and how the data are organised in the program.  Data come in different forms and types.  Most programming languages provides simple data types such as integers, real numbers and characters, and more complex data structures such as arrays, records and files which are collections of data.  Because algorithm manipulates data, we need to store the data objects into variables, and give these variables names for reference.  For example, in mathematics, we call the area of a circle A, and express A in terms of the radius r.  (In programming, we would use more telling variable names such as area and radius instead of A and r in general, for the sake of readability.)  When the program is run, each variable occupies some memory location(s), whose size depends on the data type of the variable, to hold its value. 

0 comments:

Post a Comment

Your Suggestions and Reviews are valuable to us to make this blog better........