implementation of a list using arrays in c#