logo CodeStepByStep logo

DictionaryMystery

Language/Type: C# Dictionary collections

What is the output of the following code?

SortedDictionary dict = new SortedDictionary();
dict["K"] = "Schwarz";
dict["C"] = "Lee";
dict["M"] = "Sahami";
dict["M"] = "Stepp";
dict.Remove("Stepp");
dict.Remove("K");
dict["J"] = "Cain";
dict.Remove("C, Lee");
Console.WriteLine(dict);
output
(order shuffled)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.