1.

Consider A Two-dimensional Integer Array Of Size N ×m That Is To Be Used In Your Favorite Programming Language. Using The Array As An Example, Illustrate The Difference? Between The Three Levels Of Data Abstraction, And between A Schema And Instances?

Answer»

LET tgrid be a two-dimensional integer array of size n × m.

    • The physical level would simply be m × n (probably consecutive) storage locations of whatever size is specified by the implementation (e.g., 32 bits each).
    • The conceptual level is a grid of boxes, each possibly CONTAINING an integer, which is n boxes high by m boxes WIDE.
    • There are 2m×n possible views. For example, a view might be the entire array, or particular row of the array, or all n rows but only columns 1 through i.
    • Consider the following Pascal DECLARATIONS: type tgrid = array[1..n, 1..m] of integer; var vgrid1, vgrid2 : tgrid Then tgrid is a schema, whereas the value of VARIABLES vgrid1 and vgrid2 are instances.
    • To illustrate further, consider the schema array[1..2, 1..2] of integer. Two instances of this scheme are:

Let tgrid be a two-dimensional integer array of size n × m.



Discussion

No Comment Found

Related InterviewSolutions