1.

Consider A Grid File In Which We Wish To Avoid Overflow Buckets For Performance Reasons. In Cases Where An Overflow Bucket Would Be Needed, We Instead Reorganize The Grid File. Present An Algorithm For Such A Reorganization?

Answer»

Let US consider a two-dimensional grid array. When a bucket overflows, we can split the RANGES corresponding to that row and COLUMN into two, in both the linear scales. Thus the linear scales will get one additional entry each, and the bucket is split into four buckets. The ranges should be split in such a way as to ensure that the four resultant buckets have nearly the same NUMBER of VALUES.

There can be several other heuristics for deciding how to reorganize the ranges, and hence the linear scales and grid array.

Let us consider a two-dimensional grid array. When a bucket overflows, we can split the ranges corresponding to that row and column into two, in both the linear scales. Thus the linear scales will get one additional entry each, and the bucket is split into four buckets. The ranges should be split in such a way as to ensure that the four resultant buckets have nearly the same number of values.

There can be several other heuristics for deciding how to reorganize the ranges, and hence the linear scales and grid array.



Discussion

No Comment Found

Related InterviewSolutions