Professional Documents
Culture Documents
Safe Elastic Integer Arrays: National University of Computer and Emerging Sciences, Lahore Campus
Safe Elastic Integer Arrays: National University of Computer and Emerging Sciences, Lahore Campus
Instructions:
Discussion with your class fellows is encouraged but remember that this is an individual assignment and
plagiarism in all forms (copy someone’s code or sharing your code with others) is strictly prohibited and will
result in non-positive (negative) marks.
Programmer using these arrays will be allowed to use both non-negative and negative indices to access
the data stored in these arrays and the arrays will be safe in the sense that the programmer will be
unable to access an index that is not part of the array or in other words each integer will be mapped to
a valid index in the array.
To implement this notion we will need to keep a record of number of dimensions and size of each
dimension of the array along with the memory area reserved to store the array data. As discussed in
class, for this assignment we will keep this information in a structure/record defined using the struct
defining facility available in the language.
A proposed struct definition and some basic functions have been defined for your convenience and
your main responsibility is to complete this definition and provide definition of all necessary functions
needed to implement the notion of SAFE ELASTIC ARRAYS.