Hash Table是一种有key value的资料结构~
我们能在Hash Table中存入一个value然後将它对应到key~
其目的是为了~ 加快程序访问value的速度(O(1))~
学习目标: Hash Table概念及实务
学习难度: ☆☆☆
namespace ConsoleApp1
{
class MainProgram
{
static void Main()
{
Hashtable hashtable = new Hashtable();
hashtable.Add("wilson", "student"); //wilson(key),student(value)
hashtable.Add("william", "student"); //wilson(key),student(value)
hashtable.Remove("william"); //remove key
Console.WriteLine(hashtable.ContainsKey("wilson")); //回传true
Console.WriteLine(hashtable.ContainsValue("student")); //回传true
foreach (DictionaryEntry tuple in hashtable)
{
Console.Write(tuple.Key + " ");
Console.Write(tuple.Value + "\n");
}
}
}
}
参考资料:
https://www.youtube.com/watch?v=s8YcbwVl-HI&ab_channel=RenaissanceCoders
https://www.geeksforgeeks.org/hashing-data-structure/
<<: 【Docker】02 使用CentOS系统安装Apache+PHP+MySQL
前言: 手写辨识是最基本入门款,利用第22天canvas手势绘图和参照tensorflow 的cod...
阿呜~第23天了,再撑一个星期~XDD" ▉A.18 Compliance 遵循性 所有的...
Vue的诞生是因为作者尤雨溪希望能同步DOM和JavaScript的物件,在2013年6月他的名字是...
前言 有关虚拟化网路服务的技术慢慢的成熟,对於虚拟化的功能要如何去做管理成了接下来重点,因此再来的几...
Summary: GIF have become such an important part in...