列表和字典之间的区别? [英] difference between list and dictionary?
本文介绍了列表和字典之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是List?
什么是字典?
i需要重大差异
What is List??
What is Dictionary??
i need Major Difference
推荐答案
你为什么不用谷歌?
http:// lmgtfy .com /?q = c%23 + list + vs + dictionary [ ^ ]
Why don't you use google?
http://lmgtfy.com/?q=c%23+list+vs+dictionary[^]
hi luisenike,
list: -
1)它一次接受类似的数据类型值。(一次只有单个数据类型为int或string或等........
ex: - list< int>
//请注意这个
{
hi luisenike,
list:-
1)it accepts similar data type values at a time.(only single data type at a time either int or string or etc........
ex:- list < int >
//please observe this
{
List<int> list = new List<int>();
list.Add(2);
list.Add(3);
list.Add(7);
}
2)列表类型非常适合无法通过键访问的线性集合。
字典: -
1)它一次接受不同的数据类型。
ex: - Dictionary< String,int>
//观察这个
{
}
2)List type is ideal for linear collections not accessed by keys.
Dictionary:-
1) it accepts different data types at a time.
ex:- Dictionary < String,int >
//observe this
{
Dictionary<string, int> dictionary =
new Dictionary<string, int>();
dictionary.Add("naresh", 2);
dictionary.Add("luisenike", 1);
dictionary.Add("sagar", 0);
dictionary.Add("rajsekar", -1);
}
2)字典由单独的键和值组成。
问候:
nareshraju
}
2) Dictionary is composed of separate keys and values.
regards:
nareshraju
参考这些:
http://geekswithblogs.net/MarkPearl/archive/2010/03/11/nails-vs -screws -c-list-vs-dictionary.aspx [ ^ ]
http://www.dotnetperls.com/dictionary-time [ ^ ]
Refer these:
http://geekswithblogs.net/MarkPearl/archive/2010/03/11/nails-vs-screws-c-list-vs-dictionary.aspx[^]
http://www.dotnetperls.com/dictionary-time[^]
这篇关于列表和字典之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文