zoukankan
html css js c++ java
javascript中实现的hashtable
function
Hashtable()
{
this
._hash
=
new
Object();
this
.add
=
function
(key,value)
{
if
(
typeof
(key)
!=
"
undefined
"
)
{
if
(
this
.contains(key)
==
false
)
{
this
._hash[key]
=
typeof
(value)
==
"
undefined
"
?
null
:value;
return
true
;
}
else
{
return
false
;
}
}
else
{
return
false
;
}
}
this
.remove
=
function
(key)
{
delete
this
._hash[key];}
this
.count
=
function
()
{
var
i
=
0
;
for
(
var
k
in
this
._hash)
{i
++
;}
return
i;}
this
.items
=
function
(key)
{
return
this
._hash[key];}
this
.contains
=
function
(key)
{
return
typeof
(
this
._hash[key])
!=
"
undefined
"
;}
this
.clear
=
function
()
{
for
(
var
k
in
this
._hash)
{
delete
this
._hash[k];}
}
}
var
a
=
new
Hashtable();
a.add(
"
aa
"
);
a.add(
"
bb
"
,
2342
);
a.add(
"
bb
"
,
2342
);
a.remove(
"
aa
"
);
alert(a.count());
alert(a.contains(
"
bb
"
));
alert(a.contains(
"
aa
"
));
alert(a.items(
"
bb
"
));
查看全文
相关阅读:
试验thrift做后端rpc,nginx做web服务器, python后端php前端
DBSCAN算法
用VAE(variational autoencoder)做sentence embedding/representation或者其他任何结构数据的热presentation
关于rnn神经网络的loss函数的一些思考
神经网络建模的一些感悟;
embedding based logistic regression-神经网络逻辑回归tensorflow
Farseer.net轻量级开源框架说明及链接索引
什么是表达式树,它与表达式、委托有什么区别?(1)
Farseer.net轻量级ORM开源框架 V1.x 教程目录
Farseer.net轻量级ORM开源框架 V1.8版本升级消息
原文地址:https://www.cnblogs.com/jacktu/p/1011504.html
最新文章
分析cocos2d-x中的CrystalCraze示例游戏
记一个全局变量"冒充"局部变量引起的bug
学习python
如何在batch脚本中嵌入python代码
实现Linux与Windows下一致的命令行
关于code reiview
基于 HAProxy 搭建 EMQ X 集群
EMQ X Neuron V1.1.1 正式发布,增加南北协议报文显示和日志追踪
ESP8266 + MQTT :如何实现 LED 灯的远程控制
轻松应对海量数据下发,三一华兴数字化升级改造背后的「秘密」
热门文章
Kuiper 1.1.0 正式发布
EMQ 携手 NNG 联合发布新一代超轻量边缘 MQTT 消息引擎 NanoMQ
Kuiper 1.0.2 正式发布
赋能社区充电场景的云边一体化充电桩运营方案(EMQ + 依威能源)
通过 NGINX Ingress Controller 访问 Kubernetes 集群中的 EMQ X
规则引擎与LwM2M重大改进!EMQ X 企业版 4.2.2 正式发布
深度学习岗位面试题
机器学习神经网络的一些大众误解
我用过或者看过的一些经典NLP神经网络结构
几种Autoencoder的深入理解和思考
Copyright © 2011-2022 走看看