Representation of records, Data Structure & Algorithms

Records are mapped onto a computer store by simply juxtaposing their elements. The address of a component (field) r relative to the origin address of the record r is named the field'si offset k. It is describeded as

k  =  si 1 + s2 + ... + si-1 k0 = 0

where s is the size (in words) of the j-th element. We now realize that the fact that all elements of an array are of same kind has the welcome consequence that  k = i×s. The generality of the record structure does unfortunately not give such a simple, linear method for offset address computation, and it is therefore the best reason for the need that record elements be selectable only by fixed identifiers. This restriction has the available benefit that the respective offsets are find at compile time. The assigning greater efficiency of record field access is well-known.

The method of packing can be beneficial, if several record elements can be fitted into a single storage word. Since offsets are computable by the compiler, the offset of a field packed within a class can also be described by the compiler. This seems that on many computers packing of records causes a deterioration in access efficiency considerably lesser than that caused by the packing of arrays.

 

1155_Records.png

Posted Date: 7/27/2012 6:20:01 AM | Location : United States







Related Discussions:- Representation of records, Assignment Help, Ask Question on Representation of records, Get Answer, Expert's Help, Representation of records Discussions

Write discussion on Representation of records
Your posts are moderated
Related Questions
A full binary tree with n leaves have:- 2n -1 nodes.

example of stack using flowchart

The complexity Ladder: T(n) = O(1). It is called constant growth. T(n) does not raise at all as a function of n, it is a constant. For illustration, array access has this c

Question 1 Discuss the advantages of implementation checks preconditions Question 2 Write a ‘C' program to search for an item using binary search Question 3 Show that To

Decision Tree A decision tree is a diagram that shows conditions and actions sequentially and therefore shows which condition is to be considered first, second and so on. It is

Simulation of queues: Simulation is the process of forming an abstract model of a real world situation in order to understand the effect of modifications and the effect of introdu

As we talked in class, a program with two integer variables is universal. Now, we consider a special form of four variableprograms. Let G = (V; E) be a directed graph, where V is a

The data structure needed for Breadth First Traversal on a graph is Queue

The following formula is used to calculate n: n = x * x/(1 - x) . Value x = 0 is used to stop algorithm. Calculation is repeated using values of x until value x = 0 is input. There

Preconditions assertion A precondition is an assertion which should be true at the initiation of an operation. For instance, a square root operation can't accept a negative a