摘要: 看例子把出现频率a 4 b 2 c1 d1则c d b a1 1 2 4则c d 2 就变成了 2 2 4则2 2 4则变成了4 4在变则成饿了 8所以 8 4 a2 bc d则左节点为0 右节点为1则a为1 b 01 c 000 d 001 阅读全文
posted @ 2015-10-19 14:36 尘梦 阅读(165) 评论(0) 推荐(0)
摘要: 输出描述:如果数组中存在 item,则返回元素在数组中的位置,否则返回 -1输入例子:indexOf([ 1, 2, 3, 4 ], 3)输出例子:2 function indexOf(arr, item) { if (Array.prototype.indexOf){ return ... 阅读全文
posted @ 2015-10-19 13:38 尘梦 阅读(409) 评论(0) 推荐(0)