什么是HashTable?什么是HashTable的用途? [英] What is HashTable ? and what is the use of HashTable?

查看:116
本文介绍了什么是HashTable?什么是HashTable的用途?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是HashTable?什么是HashTable?

解决方案

请点击链接



http://www.w3schools.com/aspnet/aspnet_hashtable.asp [ ^ ]

http://www.c-sharpcorner.com/UploadFile/mahesh/Hashtable11082005171748PM/Hashtable.aspx [ ^ ]

http://www.aspnettutorials.com/tutorials/database/hash-table-aspnet2-csharp.aspx [< a href =http://www.aspnettutorials.com/tutorials/database/hash-table-aspnet2-csharp.aspxtarget =_ blanktitle =N ew Window> ^ ]

谢谢


Hashtable 的使用与它支持用O(1)的计算复杂度通过某个键查找集合元素的事实;也就是说,随着收藏量的增加,搜索渐近的时间并没有增长,但平均而言仍然大致相同,收藏量很大。



请参阅:

http://en.wikipedia.org/wiki/Big_O_notation [ ^ ],

http://en.wikipedia.org/wiki/Computational_complexity_theory [ ^ ]。



此外,类型支持收集范围内密钥的唯一性。 />


.NET中这种类型的问题是它已经过时了,因为它不是通用的,这需要潜在的容易出错的类型转换。 没有理由在任何新开发中使用它,因为.NET Framework v.2.0中引入了泛型,并且使用早期的.NET版本几乎没有任何意义。此类型未正式标记 [已废弃] 属性,因为将其保留在现有且运行良好的遗留代码中没有任何问题。



在任何新的开发中,你应该使用三种泛型类型中的任何一种而不是 HashTable

http://msdn.microsoft.com/en-us/library/xfhwa508.aspx [ ^ ],

< a href =http://msdn.microsoft.com/en-us/library/f7fta44c.aspx> http://msdn.microsoft.com/en-us/library/f7fta44c.aspx [< a href =http://msdn.microsoft.com/en-us/library/f7fta44c.aspxtarget =_ blanktitle =New Window> ^ ],

http://msdn.microsoft.com/en-us/library/ms132319.aspx [ ^ ]。



这些类别的主要区别在于性能和冗余之间的不同权衡。



-SA


http:// www.dotnetperls.com/hashtable [ ^ ]

What is HashTable ? and what is the use of HashTable?

解决方案

Please follow the link

http://www.w3schools.com/aspnet/aspnet_hashtable.asp[^]
http://www.c-sharpcorner.com/UploadFile/mahesh/Hashtable11082005171748PM/Hashtable.aspx[^]
http://www.aspnettutorials.com/tutorials/database/hash-table-aspnet2-csharp.aspx[^]
Thanks


The uses of Hashtable is related to the fact that it supports lookup of an element of collection by some key with the computational complexity of O(1); that is, the time of search asymptotically does not grow with growing the size of the collection but remains approximately the same on average, with big collections.

Please see:
http://en.wikipedia.org/wiki/Big_O_notation[^],
http://en.wikipedia.org/wiki/Computational_complexity_theory[^].

Also, the type support uniqueness of the key in the scope of collection.

The problem with this type in .NET is that its is the obsolete because it is not generic, which required potentially error-prone type casts. There is no reason to ever use it in any new development, because generics were introduced in .NET Framework v.2.0, and using earlier .NET version hardly makes any sense. This type was not formally marked with [Obsolete] attribute just because there is nothing wrong with keeping it in existing and well working legacy code.

In any new development, you should to use any of the three generic types instead of HashTable:
http://msdn.microsoft.com/en-us/library/xfhwa508.aspx[^],
http://msdn.microsoft.com/en-us/library/f7fta44c.aspx[^],
http://msdn.microsoft.com/en-us/library/ms132319.aspx[^].

These classes are different majorly by different trade-off between performance and redundancy.

—SA


http://www.dotnetperls.com/hashtable[^]


这篇关于什么是HashTable?什么是HashTable的用途?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆