05 2019 档案
摘要:数独 游戏规则 检查算法 数独自动求解 js const NOTASIGN = 0 function usedInCol(map,row,num){ for(let col = 0; col
阅读全文
摘要:迷宫找出口 js function isSafe(maze,x,y){ if(x = 0 && y = 0 && x
阅读全文
摘要:初始化地图 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(
阅读全文
摘要:冒泡排序 每冒泡一次有序度加1,逆序度减1 插入排序 无序数组中取一个要插入的元素和有序数组中要插入的元素进行比较,找到要插入的位置 js const selectionSort = (arr) = { if (arr.length arr[j]){ minIndex = j } } [arr[i]
阅读全文
摘要:```js
class TrieNode { constructor(data){ this.data = data this.children = new Array(26) this.isEndingChar = false this.text = '' }
} class TrieTree { cons...
阅读全文
摘要:AC自动机 js class ACNode { constructor(data){ this.data = data this.isEndingChar = false this.children = new Map() this.length = 0 this.fail = null } } c
阅读全文
摘要:最短编辑距离 js function levenshteinDistance(a,b){ //生成表 const distanceMatix = Array(a.length + 1).fill(null).map(() = Array(b.length + 1).fill(null)) //第一行
阅读全文

浙公网安备 33010602011771号