随笔分类 - 学算法
摘要:二叉排序树 class Node { constructor(value) { this.value = value this.left = null this.right = null } } class Tree { constructor() { this.root = null this.t
阅读全文
摘要:简单哈希表 class Pair { constructor(key, value) { this.key = key this.value = value } } class Hash { constructor() { this.buckets = new Array(100).fill(nul
阅读全文
摘要:单链表 class Node { constructor(data) { this.data = data this.next = null } } class NodeList { constructor() { this.head = null this.length = 0 } appendN
阅读全文
摘要:异或运算 1.0和任何数字异或 任何数字本身 2.相同数字异或 0,不相同数字异或 1 3.遵循交换律,结合律 题目 给定一个包含 [0, n] 中 n 个数的数组 nums ,找出 [0, n] 这个范围内没有出现在数组中的那个数。 输入:nums = [3,0,1] 输出:2 输入:nums =
阅读全文

浙公网安备 33010602011771号