Cross-cutting Issues in Data Structures #
Shadow copy #
The concept of shadow copy is a recurring theme in computer science. In this method, two copies of a data structure is maintained - an active or working copy and a shadow copy. In the context of arrays, the shadow copy is larger than the active copy and is under-construction before it is assigned as the active copy. In many other data structures, active copy and shadow copy can be of same size. In addition, three different techniques exist regarding active and shadow copy management. The first technique is to keep the memory allocation for active and shadow copy fixed for the lifetime of the process, instead the data gets moved from active to shadow copy. The second technique is to cycle between the two copies by alternatively mark one copy as active and the other as shadow in one cycle and switch it in the next cycle. [I will add more about the third technique in future, as it is currently waiting to be published.]