10 2018 档案

摘要:饮水思源:https://www.bilibili.com/video/av12198966 自定义log &显示分数: //let log = console.log.bind(console); let e = sel => document.querySelector(sel); let lo 阅读全文
posted @ 2018-10-26 22:06 xkfx 阅读(278) 评论(0) 推荐(1) 编辑
摘要:饮水思源:https://www.bilibili.com/video/av12168808 添加砖块(先写一个砖块 再弄成n个)&通过暂停与减速来debug: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> 阅读全文
posted @ 2018-10-24 10:15 xkfx 阅读(224) 评论(0) 推荐(1) 编辑
摘要:饮水思源:https://www.bilibili.com/video/av12138532 原始版本: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <style type="text/css"> canv 阅读全文
posted @ 2018-10-22 22:51 xkfx 阅读(306) 评论(0) 推荐(1) 编辑
摘要:6.5-1 略 6.5-2 略 6.5-3 #005# 优先队列 6.5-4 为了正确复用Heap-increase-key中的代码 6.5-5 初始化:显然满足 保持:如果在迭代之前循环不变式为真,那么要么不再进行迭代(A[parent(i)]>A[i]),此时已经保持了循环不变式,要么进行一次交 阅读全文
posted @ 2018-10-15 09:48 xkfx 阅读(652) 评论(0) 推荐(1) 编辑
摘要:留着备用。 “first-in largest-out”最大优先队列: 便于copy版最大优先队列: class PriorityQueue { constructor() { this.A = []; Heap.buildMaxHeap(this.A); } isEmpty() { return 阅读全文
posted @ 2018-10-14 15:17 xkfx 阅读(220) 评论(0) 推荐(0) 编辑
摘要:留着备用。 Heap是一种满足特定性质的数组,如下: 阅读全文
posted @ 2018-10-13 15:01 xkfx 阅读(173) 评论(0) 推荐(1) 编辑
摘要:原址排序,且时间复杂度是O(nlgn)的一种排序算法。 js代码: 阅读全文
posted @ 2018-10-10 15:52 xkfx 阅读(139) 评论(0) 推荐(0) 编辑
摘要:6.2-1 略 6.2-2 比较元素大小的地方">"改成"<",运行时间没变化。 6.2-3 原数组不会有任何改变。 6.2-4 因为当i>a.heap-size/2时,i为叶子节点下标,所以原数组不会有改变。 6.2-5 6.2-6 略。。 阅读全文
posted @ 2018-10-10 15:23 xkfx 阅读(381) 评论(0) 推荐(0) 编辑
摘要:离散型hopfield神经网络。参考自http://web.cs.ucla.edu/~rosen/161/notes/hopfield.html实现的草稿版本: 阅读全文
posted @ 2018-10-10 14:47 xkfx 阅读(348) 评论(0) 推荐(0) 编辑
摘要:6.1-1 2^(h+1) - 1 和 2^h 6.1-2 设树的高度为h 由2^h <= n <= 2^(h+1) - 1 < 2^(h+1) 得h <= lgn < h+1 故h=lgn向下取整 6.1-3 根据定义,最大堆中A[PARENT(i)] >= A[i]恒成立,由不等式的传递性,可以 阅读全文
posted @ 2018-10-09 16:33 xkfx 阅读(440) 评论(0) 推荐(0) 编辑
摘要:4.1-1 返回数组的首个元素 4.1-2 最大子数组问题(js描述) 4.1-3 应该会吧.. 4.1-4 基本保持原有代码不变,在最后增加一次判断 if result.sum < 0 then result.sum = 0 并设置结果数组为空 4.1-5 最大子数组问题(js描述) 阅读全文
posted @ 2018-10-07 10:59 xkfx 阅读(1053) 评论(0) 推荐(0) 编辑
摘要:留着备用。 js代码: 数组长度为20实测(各跑100次)↓ 数组长度为100实测(各跑100次)↓ 数组长度为500实测(各跑100次)↓ 阅读全文
posted @ 2018-10-05 17:18 xkfx 阅读(756) 评论(0) 推荐(0) 编辑
摘要:留着备用。 js代码: Python代码: 阅读全文
posted @ 2018-10-05 17:17 xkfx 阅读(159) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示