Multidimensional data structure?
- by Austin Truong
I need a multidimensional data structure with a row and a column.
Must be able to insert elements any location in the data structure. Example: {A , B} I want to insert C in between A and B. {A, C, B}.
Dynamic: I do not know the size of the data structure.
Another example: I know the [row][col] of where I want to insert the element. EX. insert("A", 1, 5), where A is the element to be inserted, 1 is the row, 5 is the column.
EDIT
I want to be able to insert like this.
static void Main(string[] args)
{
Program p = new Program();
List<string> list = new List<string>();
list.Insert(1, "HELLO");
list.Insert(5, "RAWR");
for (int i = 0; i < list.Count; i++)
{
Console.WriteLine(list[i]);
}
Console.ReadKey();
}
And of course this crashes with an out of bounds error.
So in a sense I will have a user who will choose which ROW and COL to insert the element to.