Hello,
I am trying to create a dictionary item with its key as list type and value as custom object type. It gives me a error
"An item with the same key has already been added."
Here is my code:
where m.GetElement(r, n - 1) returns a Polynomial type object.
Please help me out. I'm stuck.
I am trying to create a dictionary item with its key as list type and value as custom object type. It gives me a error
"An item with the same key has already been added."
Here is my code:
Code:
List<int> Pkey = new List<int>(); Dictionary<List<int>, Polynomial> A = new Dictionary<List<int>, Polynomial>(); // initialize A with last column. for (int r = 0; r < n; ++r) { Pkey.Clear(); Pkey.Add(r); A.Add(Pkey, m.GetElement(r, n - 1)); }
Please help me out. I'm stuck.
Comment