Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which of the following concepts make extensive use of arrays ?

  • A.Binary trees
  • B.Scheduling of processes
  • C.Caching
  • D.Spatial locality

Answer: D

The concept given is spatial locality, the fourth option.

An array is stored as one block of consecutive memory locations, and programs usually walk through it element by element. After one element is read, the neighbouring ones are very likely to be read next. This is spatial locality, and arrays are its standard example; it is why a cache loads a whole line of neighbouring words at once.

Binary trees are normally built from nodes linked by pointers, although a complete tree can be stored in an array as a heap is. Scheduling of processes works with queues or lists of process records. Caching is a hardware or software technique that exploits locality and holds data in lines or entries, but it is the locality of array access that makes it pay.

This is a loosely worded item, since a cache itself is built from arrays of lines and a tree can be stored in an array; the official key selects spatial locality as the concept most closely tied to arrays, and this explanation follows it.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.