From 7ecda3d53a2c7ed7e43f636f5bcae85d38892cbf Mon Sep 17 00:00:00 2001 From: cs <2268380485@qq.com> Date: Tue, 29 Apr 2025 18:20:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=B8=85=E7=90=86:=E5=87=86?= =?UTF-8?q?=E5=A4=87=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jiahao/User.java | 10 ------ src/other/temp.js | 35 ------------------- src/other/tree.js | 80 -------------------------------------------- src/other/tree2.js | 63 ---------------------------------- 4 files changed, 188 deletions(-) delete mode 100644 src/jiahao/User.java delete mode 100644 src/other/temp.js delete mode 100644 src/other/tree.js delete mode 100644 src/other/tree2.js diff --git a/src/jiahao/User.java b/src/jiahao/User.java deleted file mode 100644 index f49daae..0000000 --- a/src/jiahao/User.java +++ /dev/null @@ -1,10 +0,0 @@ -// -// -// -// -// -// -// -// -// -// \ No newline at end of file diff --git a/src/other/temp.js b/src/other/temp.js deleted file mode 100644 index bab6201..0000000 --- a/src/other/temp.js +++ /dev/null @@ -1,35 +0,0 @@ -// KMP 算法实例 -function kmpSearch(str, pattern) { - // 生成 next 数组 - function getNext(pattern) { - - } - - const next = getNext(pattern); - let i = 0; - let j = 0; - while (i < str.length && j < pattern.length) { - if (j === -1 || str[i] === pattern[j]) { - i++; - j++; - } - } - - if (j === pattern.length) { - return i - j; - } - return -1; -} - -//try to use KMP -var strStr = function(haystack, needle) { - return kmpSearch(haystack, needle); -}; -// 本地git账号邮箱密码重新配置了 -// 再次尝试使用新身份提交 - -// 本地git账号邮箱密码重新配置了 -// 再次尝试使用新身份提交到非主支 - -// 本地git账号用户名改成cs了 -// 再次尝试使用新身份提交到非主支 \ No newline at end of file diff --git a/src/other/tree.js b/src/other/tree.js deleted file mode 100644 index 2498926..0000000 --- a/src/other/tree.js +++ /dev/null @@ -1,80 +0,0 @@ -// tree.js -// 实现一个树结构 -class Tree { - constructor(data) { - this.data = data; - this.children = []; - } -} -module.exports = Tree; -// 相关的方法 -// 插入子节点 -Tree.prototype.insert = function(data) { - this.children.push(new Tree(data)); -} -// 遍历树 -Tree.prototype.traverse = function(callback) { - callback(this.data); - for (let i = 0; i < this.children.length; i++) { - this.children[i].traverse(callback); - } -} -// 查找树 -Tree.prototype.find = function(data) { - if (this.data === data) { - return this; - } - for (let i = 0; i < this.children.length; i++) { - let result = this.children[i].find(data); - if (result) { - return result; - } - } - return null; -} -// 删除树 -Tree.prototype.remove = function(data) { - for (let i = 0; i < this.children.length; i++) { - if (this.children[i].data === data) { - this.children.splice(i, 1); - return; - } - } -} -// 清空树 -Tree.prototype.clear = function() { - this.children = []; -} -// 树的高度 -Tree.prototype.height = function() { - let height = 0; - for (let i = 0; i < this.children.length; i++) { - let childHeight = this.children[i].height(); - if (childHeight > height) { - height = childHeight; - } - } - return height + 1; -} -// 树的深度 -Tree.prototype.depth = function() { - let depth = 0; - let parent = this.parent; - while (parent) { - depth++; - parent = parent.parent; - } - return depth; -} -// 树的大小 -Tree.prototype.size = function() { - let size = 1; -} -// 树的叶子节点 -Tree.prototype.leaf = function() { - let leaf = 0; -} -// 树的节点数 -Tree.prototype.node = function() { - let node = 0; -} diff --git a/src/other/tree2.js b/src/other/tree2.js deleted file mode 100644 index 95f1dd2..0000000 --- a/src/other/tree2.js +++ /dev/null @@ -1,63 +0,0 @@ -//实现二叉树 -class BinaryTree { - constructor(data) { - this.data = data; - this.left = null; - this.right = null; - } -} -BinaryTree.prototype.insert = function(data) { - if (data < this.data) { - if (this.left === null) { - this.left = new BinaryTree(data); - } - } -} -BinaryTree.prototype.traverse = function(callback) { - if (this.left !== null) { - this.left.traverse(callback); - } -} -// 查找树 -BinaryTree.prototype.find = function(data) { - if (this.data === data) { - return this; - } - for (let i = 0; i < this.children.length; i++) { - let result = this.children[i].find(data); - if (result) { - return result; - } - } - return null; -} -// 删除树 -BinaryTree.prototype.remove = function(data) { - for (let i = 0; i < this.children.length; i++) { - if (this.children[i].data === data) { - this.children.splice(i, 1); - return; - } - } -} -// 清空树 -BinaryTree.prototype.clear = function() { - this.children = []; -} -// 树的高度 -BinaryTree.prototype.height = function() { - let height = 0; -} -// 树的深度 -BinaryTree.prototype.depth = function() { - let depth = 0; -} -// 树的大小 -BinaryTree.prototype.size = function() { - let size = 0; -} -// 树的叶子节点 -BinaryTree.prototype.leaf = function() { - let leaf = 0; -} -module.exports = BinaryTree; \ No newline at end of file