G
Guest
I'm not comprehending how C# assigns indexes to items you add to a SortedList
item. Here's some example code:
sl.Add ("first_item","First Item");
sl.Add ("second_item", "Second Item");
sl.Add ("third_item","third item");
sl.Add ("fourth_item","fourth item");
I then run a FOR loop to print out the index for each item in the
SortedList, and the index values for each item are completely crazy! Here
they are:
first_item = 0
fourth_item = 1
second_item = 2
third_item =3
Since I'm not working with stacks or queue's, I don't believe FIFO or LIFO
is coming into play here...can anyone explain?
item. Here's some example code:
sl.Add ("first_item","First Item");
sl.Add ("second_item", "Second Item");
sl.Add ("third_item","third item");
sl.Add ("fourth_item","fourth item");
I then run a FOR loop to print out the index for each item in the
SortedList, and the index values for each item are completely crazy! Here
they are:
first_item = 0
fourth_item = 1
second_item = 2
third_item =3
Since I'm not working with stacks or queue's, I don't believe FIFO or LIFO
is coming into play here...can anyone explain?