05 2019 档案

摘要:数独 游戏规则 检查算法 数独自动求解 js const NOTASIGN = 0 function usedInCol(map,row,num){ for(let col = 0; col 阅读全文
posted @ 2019-05-17 23:17 pluscat 阅读(1276) 评论(0) 推荐(0)
摘要:迷宫找出口 js function isSafe(maze,x,y){ if(x = 0 && y = 0 && x 阅读全文
posted @ 2019-05-17 23:16 pluscat 阅读(198) 评论(0) 推荐(0)
摘要:初始化地图 js function initMaze(r,c){ let row = new Array(2 r + 1) for(let i = 0; i { const visited = [], key = [], parent = []; let {length} = graph; for( 阅读全文
posted @ 2019-05-16 21:50 pluscat 阅读(2354) 评论(0) 推荐(0)
摘要:冒泡排序 每冒泡一次有序度加1,逆序度减1 插入排序 无序数组中取一个要插入的元素和有序数组中要插入的元素进行比较,找到要插入的位置 js const selectionSort = (arr) = { if (arr.length arr[j]){ minIndex = j } } [arr[i] 阅读全文
posted @ 2019-05-06 21:09 pluscat 阅读(347) 评论(0) 推荐(0)
摘要:```js class TrieNode { constructor(data){ this.data = data this.children = new Array(26) this.isEndingChar = false this.text = '' } } class TrieTree { cons... 阅读全文
posted @ 2019-05-05 16:05 pluscat 阅读(204) 评论(0) 推荐(0)
摘要:AC自动机 js class ACNode { constructor(data){ this.data = data this.isEndingChar = false this.children = new Map() this.length = 0 this.fail = null } } c 阅读全文
posted @ 2019-05-04 23:41 pluscat 阅读(356) 评论(0) 推荐(0)
摘要:最短编辑距离 js function levenshteinDistance(a,b){ //生成表 const distanceMatix = Array(a.length + 1).fill(null).map(() = Array(b.length + 1).fill(null)) //第一行 阅读全文
posted @ 2019-05-03 13:13 pluscat 阅读(452) 评论(0) 推荐(0)