【代碼隨想錄】刷題筆記——二叉樹篇

目錄

144. 二叉樹的前序遍歷

94. 二叉樹的中序遍歷

145. 二叉樹的后序遍歷

102. 二叉樹的層序遍歷

226. 翻轉二叉樹

101. 對稱二叉樹

104. 二叉樹的最大深度

111. 二叉樹的最小深度

222. 完全二叉樹的節點個數

110. 平衡二叉樹

257. 二叉樹的所有路徑

404. 左葉子之和

513. 找樹左下角的值

112. 路徑總和

106. 從中序與后序遍歷序列構造二叉樹

654. 最大二叉樹

617. 合并二叉樹

700. 二叉搜索樹中的搜索

98. 驗證二叉搜索樹

530. 二叉搜索樹的最小絕對差

236. 二叉樹的最近公共祖先

235. 二叉搜索樹的最近公共祖先

701. 二叉搜索樹中的插入操作

450. 刪除二叉搜索樹中的節點

669. 修剪二叉搜索樹

108. 將有序數組轉換為二叉搜索樹

538. 把二叉搜索樹轉換為累加樹


144. 二叉樹的前序遍歷

思路

代碼(遞歸)

class Solution {List<Integer> ret = new LinkedList<Integer>();public List<Integer> preorderTraversal(TreeNode root) {preorder(root);return ret;}private void preorder (TreeNode root) {if (root == null) {return;}ret.addLast(root.val);preorder(root.left);preorder(root.right);}
}

代碼(迭代)

class Solution {Stack<TreeNode> stack = new Stack<TreeNode>();List<Integer> ret = new LinkedList<Integer>();public List<Integer> preorderTraversal(TreeNode root) {preorder(root);return ret;}private void preorder (TreeNode root) {if (root == null) return;stack.push(root);while (!stack.isEmpty()) {TreeNode node = stack.pop();ret.addLast(node.val);if (node.right != null) {stack.push(node.right);}if (node.left != null) {stack.push(node.left);}}}
}

🌟代碼(統一迭代法)

class Solution {Stack<TreeNode> stack = new Stack<>();List<Integer> ret = new LinkedList<>();public List<Integer> postorderTraversal(TreeNode root) {if (root != null) stack.push(root);while (!stack.isEmpty()) {TreeNode node = stack.peek();if (node != null) {stack.pop();if (node.right != null) stack.push(node.right);if (node.left != null) stack.push(node.left);stack.push(node);stack.push(null);}else {stack.pop();ret.add(stack.pop().val);}}return ret;}
}

94. 二叉樹的中序遍歷

思路

代碼(遞歸)

class Solution {List<Integer> ret = new LinkedList<Integer>();public List<Integer> inorderTraversal(TreeNode root) {inorder(root);return ret;}private void inorder (TreeNode root) {if (root == null) return;inorder(root.left);ret.addLast(root.val);inorder(root.right);}
}

代碼(迭代)

class Solution {Stack<TreeNode> stack = new Stack<TreeNode>();List<Integer> ret = new LinkedList<Integer>();public List<Integer> inorderTraversal(TreeNode root) {inorder(root);return ret;}private void inorder (TreeNode root) {if (root == null) return;TreeNode cur = root;while (!stack.isEmpty() || cur != null) {while (cur != null) {stack.push(cur);cur = cur.left;}TreeNode node = stack.pop();ret.addLast(node.val);if (node.right != null) {cur = node.right;}}}
}

🌟代碼(統一迭代法)

class Solution {Stack<TreeNode> stack = new Stack<>();List<Integer> ret = new LinkedList<>();public List<Integer> postorderTraversal(TreeNode root) {if (root != null) stack.push(root);while (!stack.isEmpty()) {TreeNode node = stack.peek();if (node != null) {stack.pop();if (node.right != null) stack.push(node.right);stack.push(node);stack.push(null);if (node.left != null) stack.push(node.left);}else {stack.pop();ret.add(stack.pop().val);}}return ret;}
}

145. 二叉樹的后序遍歷

代碼(遞歸)

class Solution {List<Integer> ret = new LinkedList<>();public List<Integer> postorderTraversal(TreeNode root) {postorder(root);return ret;}private void postorder(TreeNode root) {if (root == null) return;postorder(root.left);postorder(root.right);ret.addLast(root.val);}
}

🌟代碼(統一迭代法)

class Solution {Stack<TreeNode> stack = new Stack<>();List<Integer> ret = new LinkedList<>();public List<Integer> postorderTraversal(TreeNode root) {if (root != null) stack.push(root);while (!stack.isEmpty()) {TreeNode node = stack.peek();if (node != null) {stack.pop();stack.push(node);stack.push(null);if (node.right != null) stack.push(node.right);if (node.left != null) stack.push(node.left);}else {stack.pop();ret.add(stack.pop().val);}}return ret;}
}

102. 二叉樹的層序遍歷

🌟代碼(迭代)

class Solution {Queue<TreeNode> queue = new LinkedList<TreeNode>();List<List<Integer>> ret = new LinkedList<List<Integer>>();public List<List<Integer>> levelOrder(TreeNode root) {lorder(root);return ret;}private void lorder(TreeNode root) {if (root == null) return;queue.offer(root);while (!queue.isEmpty()) {List<Integer> temp = new ArrayList<Integer>();int size = queue.size();while (size > 0) {TreeNode node = queue.poll();temp.add(node.val);if (node.left != null) queue.offer(node.left);if (node.right != null) queue.offer(node.right);size--;}ret.add(temp);}}
}

代碼(遞歸)

class Solution {List<List<Integer>> ret = new LinkedList<List<Integer>>();public List<List<Integer>> levelOrder(TreeNode root) {lorder(root,0);return ret;}private void lorder(TreeNode root,int deep) {if (root == null) return;deep++;if (ret.size() < deep) {List<Integer> temp = new ArrayList<Integer>();ret.add(temp);}ret.get(deep - 1).add(root.val);lorder(root.left,deep);lorder(root.right,deep);}
}

226. 翻轉二叉樹

代碼

class Solution {public TreeNode invertTree(TreeNode root) {postOrder(root);return root;}private void postOrder(TreeNode root) {if (root == null) return;postOrder(root.left);postOrder(root.right);if (root.left != null || root.right != null) {TreeNode temp = root.left;root.left = root.right;root.right = temp;}}
}

代碼(官方)

class Solution {public TreeNode invertTree(TreeNode root) {if (root == null) {return null;}TreeNode left = invertTree(root.left); // 翻轉左子樹TreeNode right = invertTree(root.right); // 翻轉右子樹root.left = right; // 交換左右兒子root.right = left;return root;}
}

101. 對稱二叉樹

思路

代碼

class Solution {public boolean isSymmetric(TreeNode root) {return check(root.left,root.right);}   private boolean check(TreeNode left ,TreeNode right) {if (left == null && right == null) return true;if (left ==null || right == null) return false;return left.val == right.val && check(left.left,right.right) && check(left.right,right.left);}
}

104. 二叉樹的最大深度

代碼

class Solution {public int maxDepth(TreeNode root) {if (root == null) return 0;return Math.max(maxDepth(root.left),maxDepth(root.right)) + 1;}
}

111. 二叉樹的最小深度

代碼

class Solution {public int minDepth(TreeNode root) {if (root == null) return 0;int left = minDepth(root.left);int right = minDepth(root.right);if (root.left != null && root.right == null) return 1 + left;if (root.right != null && root.left == null) return 1 + right;return 1 + Math.min(left,right);}
}

代碼(官方)

class Solution {public int minDepth(TreeNode root) {if(root == null) return 0;//這道題遞歸條件里分為三種情況//1.左孩子和有孩子都為空的情況,說明到達了葉子節點,直接返回1即可if(root.left == null && root.right == null) return 1;//2.如果左孩子和由孩子其中一個為空,那么需要返回比較大的那個孩子的深度        int m1 = minDepth(root.left);int m2 = minDepth(root.right);//這里其中一個節點為空,說明m1和m2有一個必然為0,所以可以返回m1 + m2 + 1;if(root.left == null || root.right == null) return m1 + m2 + 1;//3.最后一種情況,也就是左右孩子都不為空,返回最小深度+1即可return Math.min(m1,m2) + 1; }
}

222. 完全二叉樹的節點個數

代碼

class Solution {public int countNodes(TreeNode root) {if (root == null) return 0;int left = countNodes(root.left);int right = countNodes(root.right);return 1 + left + right;}
}



110. 平衡二叉樹

代碼

class Solution {public boolean isBalanced(TreeNode root) {if (root == null) return true;boolean leftbool = isBalanced(root.left);boolean rightbool = isBalanced(root.right);int left = getDepth(root.left);int right = getDepth(root.right);if (Math.abs(left-right) > 1) return false;return leftbool == true && rightbool == true ? true : false;}private int getDepth (TreeNode root) {if (root == null) return 0;return 1 + Math.max(getDepth(root.left),getDepth(root.right));}
}

257. 二叉樹的所有路徑

代碼

class Solution {StringBuilder s = new StringBuilder();List<String> ret = new ArrayList<String>();public List<String> binaryTreePaths(TreeNode root) {order(root,"",ret);return ret;}private void order (TreeNode root,String path,List<String> ret) {if (root == null) return;if (root.left == null && root.right == null) {ret.add(path + root.val);return;}order(root.left,path + root.val + "->",ret);order(root.right,path + root.val + "->",ret);}
}

代碼(官方)

    public List<String> binaryTreePaths(TreeNode root) {List<String> res = new ArrayList<>();dfs(root, "", res);return res;}private void dfs(TreeNode root, String path, List<String> res) {//如果為空,直接返回if (root == null)return;//如果是葉子節點,說明找到了一條路徑,把它加入到res中if (root.left == null && root.right == null) {res.add(path + root.val);return;}//如果不是葉子節點,在分別遍歷他的左右子節點dfs(root.left, path + root.val + "->", res);dfs(root.right, path + root.val + "->", res);}

404. 左葉子之和

代碼

class Solution {int sum = 0;public int sumOfLeftLeaves(TreeNode root) {order(root);return sum;}private void order(TreeNode root) {if (root == null) return;if (root.left !=null && root.left.left == null && root.left.right == null) {sum += root.left.val; }order(root.left);order(root.right);}
}

513. 找樹左下角的值

代碼

class Solution {Queue<TreeNode> queue = new LinkedList<TreeNode>();int lever = 0;public int findBottomLeftValue(TreeNode root) {int high = getHigh(root);if (root == null) return 0;queue.offer(root);while (!queue.isEmpty()) {List<Integer> list = new LinkedList<Integer>();int size = queue.size();while (size > 0) {TreeNode node = queue.poll();list.add(node.val);if (node.left != null) queue.offer(node.left);if (node.right != null) queue.offer(node.right);size--;}lever++;if (lever == high) return list.getFirst();}return 0;}private int getHigh (TreeNode root) {if (root == null) return 0;return 1 + Math.max(getHigh(root.left),getHigh(root.right));}
}

代碼(官方)(層序遍歷,只不斷更新每一層的第一個節點的值)

//迭代法
class Solution {public int findBottomLeftValue(TreeNode root) {if (root == null) return 0;int ret = 0;Queue<TreeNode> que = new LinkedList<TreeNode>();que.offer(root);while (!que.isEmpty()) {int size = que.size();for (int i = 0; i < size;i++) {TreeNode node = que.poll();if (i == 0) ret = node.val;if (node.left != null) que.offer(node.left);if (node.right != null) que.offer(node.right);}}return ret;}
}

112. 路徑總和

代碼

class Solution {public boolean hasPathSum(TreeNode root, int targetSum) {if (root == null) return false;if (root.left == null && root.right == null) {return targetSum == root.val;}return hasPathSum(root.left,targetSum - root.val) || hasPathSum(root.right,targetSum - root.val);        }
}

106. 從中序與后序遍歷序列構造二叉樹

代碼

class Solution {public TreeNode buildTree(int[] inorder, int[] postorder) {if(postorder.length == 0 || inorder.length == 0)return null;return buildHelper(inorder, 0, inorder.length, postorder, 0, postorder.length);}private TreeNode buildHelper(int[] inorder, int inorderStart, int inorderEnd, int[] postorder, int postorderStart, int postorderEnd){if(postorderStart == postorderEnd)return null;int rootVal = postorder[postorderEnd - 1];TreeNode root = new TreeNode(rootVal);int middleIndex;for (middleIndex = inorderStart; middleIndex < inorderEnd; middleIndex++){if(inorder[middleIndex] == rootVal)break;}int leftInorderStart = inorderStart; int leftInorderEnd = middleIndex;int rightInorderStart = middleIndex + 1;int rightInorderEnd = inorderEnd;int leftPostorderStart = postorderStart;int leftPostorderEnd = postorderStart + (middleIndex - inorderStart);int rightPostorderStart = leftPostorderEnd;int rightPostorderEnd = postorderEnd - 1;root.left = buildHelper(inorder, leftInorderStart, leftInorderEnd,  postorder, leftPostorderStart, leftPostorderEnd);root.right = buildHelper(inorder, rightInorderStart, rightInorderEnd, postorder, rightPostorderStart, rightPostorderEnd);return root;}  
}

654. 最大二叉樹

代碼

class Solution {public TreeNode constructMaximumBinaryTree(int[] nums) {if (nums.length == 0) return null;int max = 0;int index = 0;for (int i = 0; i < nums.length;i++) {if (nums[i] > max) {max = nums[i];index = i;}}TreeNode root = new TreeNode(max);TreeNode left = constructMaximumBinaryTree(Arrays.copyOfRange(nums,0,index));TreeNode right = constructMaximumBinaryTree(Arrays.copyOfRange(nums,index + 1,nums.length));root.left = left;root.right = right;return root;}
}

617. 合并二叉樹

題解

class Solution {public TreeNode mergeTrees(TreeNode root1, TreeNode root2) {if (root1 == null && root2 == null) return null;if (root1 != null && root2 == null) {return root1;}if (root1 == null && root2 != null) {return root2;}TreeNode node = new TreeNode(root1.val + root2.val);TreeNode left = mergeTrees(root1.left,root2.left);TreeNode right = mergeTrees(root1.right,root2.right);node.left = left;node.right = right;return node;}
}

700. 二叉搜索樹中的搜索

代碼

class Solution {public TreeNode searchBST(TreeNode root, int val) {if (root == null) return null;if (root.val == val) return root;if (root.val < val) {return searchBST(root.right,val);}return searchBST(root.left,val);}
}

98. 驗證二叉搜索樹

代碼

class Solution {public boolean isValidBST(TreeNode root) {if (root == null) return true;if (root.left != null) {TreeNode p = root.left;while (p.right != null) {p = p.right;}if (p.val >= root.val) return false;}if (root.right != null) {TreeNode p = root.right;while (p.left != null) {p = p.left;}if (p.val <= root.val) return false;}boolean left = isValidBST(root.left);boolean right = isValidBST(root.right);return left && right;}
}

530. 二叉搜索樹的最小絕對差

代碼

class Solution {int ret = Integer.MAX_VALUE;public int getMinimumDifference(TreeNode root) {order(root);return ret;}public void order (TreeNode root) {if (root == null) return;if (root.left != null) {TreeNode p = root.left;while (p.right != null) {p = p.right;}ret = Math.min(ret,root.val - p.val);}if (root.right != null) {TreeNode p = root.right;while (p.left != null) {p = p.left;}ret = Math.min(ret,p.val - root.val);}order(root.left);order(root.right);}
}

236. 二叉樹的最近公共祖先

代碼

class Solution {public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {if (root.val == p.val || root.val == q.val) return root;if (root.right == null || order(root.left,p) && order(root.left,q)) {return lowestCommonAncestor(root.left,p,q);}if (root.left == null || order(root.right,p) && order(root.right,q)) {return lowestCommonAncestor(root.right,p,q);}return root;}public boolean order (TreeNode root,TreeNode node) {if (root == null) return false;if (root.val == node.val) return true;return order(root.left,node) || order(root.right,node);}
}

235. 二叉搜索樹的最近公共祖先

代碼

class Solution {public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) {if (root.val < p.val && root.val < q.val) {return lowestCommonAncestor(root.right,p,q);}if (root.val > p.val && root.val > q.val) {return lowestCommonAncestor(root.left,p,q);}return root;}
}

701. 二叉搜索樹中的插入操作

代碼

class Solution {public TreeNode insertIntoBST(TreeNode root, int val) {if (root == null) {TreeNode node = new TreeNode(val);return node;}order(root,val);return root;}public void order (TreeNode root,int val) {if (root.val < val) {if (root.right == null) {TreeNode node = new TreeNode(val);root.right = node;}insertIntoBST(root.right,val);}if (root.val > val) {if (root.left == null) {TreeNode node = new TreeNode(val);root.left = node;}insertIntoBST(root.left,val);}}
}

450. 刪除二叉搜索樹中的節點

代碼

class Solution {public TreeNode deleteNode(TreeNode root, int key) {if (root == null) return null;// 根據值的大小遞歸調整左右子樹if (key < root.val) {root.left = deleteNode(root.left, key);} else if (key > root.val) {root.right = deleteNode(root.right, key);} else {// 找到待刪除節點if (root.left == null) return root.right;  // 無左子樹,返回右子樹if (root.right == null) return root.left;  // 無右子樹,返回左子樹// 有兩個子樹:找到右子樹的最小節點TreeNode minNode = findMin(root.right);root.val = minNode.val;root.right = deleteNode(root.right, minNode.val); // 遞歸刪除替換節點}return root;}private TreeNode findMin(TreeNode node) {while (node.left != null) node = node.left;return node;}
}

669. 修剪二叉搜索樹

代碼

class Solution {public TreeNode trimBST(TreeNode root, int low, int high) {if (root == null) {return null;}if (root.val < low) {return trimBST(root.right, low, high);}if (root.val > high) {return trimBST(root.left, low, high);}// 當前節點值在范圍內,遞歸處理左右子樹root.left = trimBST(root.left, low, high);root.right = trimBST(root.right, low, high);return root;}
}

108. 將有序數組轉換為二叉搜索樹

代碼

class Solution {public TreeNode sortedArrayToBST(int[] nums) {if (nums.length == 0) return null;int index = nums.length / 2;int n = nums.length;TreeNode node = new TreeNode(nums[index]);node.left = sortedArrayToBST(Arrays.copyOfRange(nums,0,index));node.right = sortedArrayToBST(Arrays.copyOfRange(nums,index + 1,n));return node;}
}

538. 把二叉搜索樹轉換為累加樹

代碼

class Solution {public TreeNode convertBST(TreeNode root) {if (root == null) return null;TreeNode right = convertBST(root.right);if (root.right !=  null) {TreeNode node = root.right;while (node.left != null) {node = node.left;}root.val += node.val;}if (root.left != null) {TreeNode node = root.left;while (node.right != null) {node = node.right;}node.val += root.val;}TreeNode left = convertBST(root.left);root.left = left;root.right = right;return root;}
}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/91481.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/91481.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/91481.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

基于deepseek的文本解析 - 超長文本的md結構化

pdf超長合同或其他超100頁非結構化文檔&#xff0c;很難全量提交deepseek進行分析&#xff0c;一般需要先進行分割。然而&#xff0c;不管是langchain還是llamaindex提供的文本分割工具&#xff0c;很難直接對非結構化文本進行準確的內容分割&#xff0c;很多原始整體段落被劃分…

介紹一個圖像修復開源項目,從模糊到清晰僅需1.7秒:HYPIR圖像修復技術如何改變數字世界?

文章概要 作為一名長期關注圖像處理技術的愛好者&#xff0c;當我第一次接觸到HYPIR這一革命性圖像修復工具時&#xff0c;我被其驚人的速度和質量所震撼。本文將全面介紹由中國科學院深圳先進技術研究院董超研究員團隊研發的HYPIR圖像修復大模型&#xff0c;詳細解析其核心技術…

基于UDP的SNMP協議

SNMP協議詳解 SNMP (Simple Network Management Protocol)&#xff0c;“簡單網絡管理協議”&#xff0c;是廣泛應用于TCP/IP網絡中&#xff0c;用于管理和監控網絡設備的一種標準協議。它允許網絡管理員查詢網絡設備的狀態信息、配置參數、接收故障告警等&#xff0c;從而實現…

3D空間中的變換矩陣

3D 空間中的變換矩陣詳解 在 3D 計算機圖形學中&#xff0c;所有幾何變換都可以通過 44 齊次變換矩陣 來表示。以下詳細介紹各種變換矩陣及其原理。 核心變換矩陣 1. 單位矩陣&#xff08;不變變換&#xff09; I[1000010000100001] I \begin{bmatrix} 1 & 0 & 0 &…

長連接(Long Connection)詳解

一、長連接基本概念長連接&#xff08;也稱為持久連接&#xff09;是指在一個TCP連接上可以連續發送多個HTTP請求/響應&#xff0c;而不是每次通信都建立新的連接。這是HTTP/1.1的默認行為&#xff0c;通過Connection: keep-alive頭部實現。二、工作原理1. 傳統短連接流程客戶端…

【匯總】接口自動化測試 + 持續集成(文末視頻演示)

技術棧&#xff1a;java testng httpclient allure fastjson jsonpath poi/yaml log4j 有建議請聯系wx&#xff1a;ren168632201 java接口自動化系列(01)&#xff1a;自動化測試框架設計(入門版) java接口自動化系列(02)&#xff1a;測試數據文件設計(excel/yam) java接…

科研快報 |無人機+AI:廣東防控基孔熱背后的技術革命

Prism Path 科 研 快 報 CS跨學科頂尖期刊論文資訊 -NO.2025001- 人工智能在登革熱預防、控制與管理中的作用&#xff1a;一項技術性敘述綜述 The role of artificial intelligence for dengue prevention, control, and management: A technical narrative review 期刊…

常見的中間件漏洞

建議&#xff1a;啟動下一個環境時&#xff0c;將上一個環境關閉&#xff0c;防止端口沖突和運行卡頓1.TomcatTomcat put方法任意文件寫入漏洞Apache Tomcat 7.0.0 - 7.0.79 Apache Tomcat 8.5.19環境&#xff1a;cd vulhub-master/tomcat/CVE-2017-12615 docker-compose up -d…

7寸工業模組 XA070Y2-L01芯顯科技詳細參數資料

芯顯7寸工業液晶屏 XA070Y2-L01 技術規格單 基礎信息 項目 參數 制造商 芯顯 型號 XA070Y2-L01 顯示技術 a-Si TN TFT-LCD 應用場景 車載中控 / 工業HMI 屏幕尺寸 7.0英寸 機械結構 特性 指標 顯示區域 152.4 91.44 mm 整機尺寸 165 104.09 9.1 mm 公差范圍 0.5 mm 表面處理…

機器學習基礎-numpy

一、相關知識點二、例子&#xff1a;import matplotlib.pyplot as plt import numpy as npplt.rcParams[font.sans-serif] [KaiTi] # 使用黑體 plt.rcParams[axes.unicode_minus] False # 解決負號顯示問題math np.random.randint(low60,high100,size50) english np.rand…

Cockpit管理服務器

Cockpit 是一個開源工具&#xff0c;通過Web Console管理Linux服務器。部署 Cockpit[rootserver ~ 11:05:26]# yum -y install cockpit?[rootserver ~ 11:30:26]# systemctl enable cockpit.socket --nowCreated symlink from /etc/systemd/system/sockets.target.wants/cockp…

處理訂單過期但支付成功的系統設計:平衡用戶體驗與業務規則

設計一個處理訂單過期但用戶支付成功的場景&#xff0c;需要平衡用戶體驗、系統一致性和業務規則。以下是一個系統化的設計方案&#xff0c;涵蓋關鍵流程、異常處理和用戶溝通&#xff1a;1. 場景分析 背景&#xff1a;用戶在下單后&#xff0c;訂單因超時而被標記為“過期”&a…

AI學習筆記三十三:基于Opencv的單目標跟蹤

若該文為原創文章&#xff0c;轉載請注明原文出處。一、功能介紹主要是想實現跟蹤視頻中的一個特定目標。使用了OpenCV庫來實現視頻中特定目標的跟蹤。需要提供視頻文件路徑以及目標在第一幀中的位置坐標&#xff08;x, y, width, height&#xff09;&#xff0c;程序會自動跟蹤…

第二篇:Three.js核心三要素:場景、相機、渲染器

第二篇&#xff1a;Three.js核心三要素&#xff1a;場景、相機、渲染器 引言 在Three.js的世界里&#xff0c;場景(Scene)、相機(Camera)和渲染器(Renderer)構成了最基礎的"鐵三角"。它們如同導演、攝像機和放映機&#xff0c;共同決定了3D內容的呈現方式。本篇將深入…

RagFlow本地源碼部署(非Docker)

參考官方文檔做個總結 1. 提前安裝好uv pipx install uv pre-commit2. 下載源碼&#xff1a; git clone https://github.com/infiniflow/ragflow.git cd ragflow/ uv sync --python 3.10 --all-extras # install RAGFlow dependent python modules uv run download_deps.py …

[免費]基于Python的招聘職位信息推薦系統(獵聘網數據分析與可視化)(Django+requests庫)【論文+源碼+SQL腳本】

大家好&#xff0c;我是python222_小鋒老師&#xff0c;看到一個不錯的基于Python的招聘職位信息推薦系統(獵聘網數據分析與可視化)(Djangorequests庫)&#xff0c;分享下哈。 項目視頻演示 【免費】基于Python的招聘職位信息推薦系統(獵聘網數據分析與可視化)(Django爬蟲) P…

國產化PDF處理控件Spire.PDF教程:Java 提取 PDF 圖片,高質量提取與圖片過濾技巧

在處理包含圖片的 PDF 文件時&#xff0c;例如掃描文檔、產品手冊或宣傳資料&#xff0c;我們經常需要將其中的圖像提取出來&#xff0c;用于保存、識別或再加工。E-iceblue旗下Spire系列產品&#xff0c;是文檔處理領域的佼佼者&#xff0c;支持國產化信創。本文將介紹如何使用…

Cesium 快速入門(七)材質詳解

Cesium 快速入門&#xff08;七&#xff09;材質詳解 看過的知識不等于學會。唯有用心總結、系統記錄&#xff0c;并通過溫故知新反復實踐&#xff0c;才能真正掌握一二 作為一名摸爬滾打三年的前端開發&#xff0c;開源社區給了我飯碗&#xff0c;我也將所學的知識體系回饋給大…

C++:結構體(Structure)

目錄 第一性原理出發&#xff1a;我們要解決什么問題&#xff1f; 定義結構體&#xff08;Defining Structures&#xff09; 問題&#xff1a;名字太長怎么辦&#xff1f; 如何定義結構體變量&#xff1f; 結構體的大小&#xff08;Size of Structures&#xff09; 初始化…

化學結構式解讀指南:從基礎認知到InDraw智能識別

中文名稱&#xff1a;3-[2-(二甲基氨基)乙基]-1H-吲哚英文名稱&#xff1a;3-[2-(dimethylamino)ethyl]-1H-indole分子式: C12H16N2分子量: 188.2740這是什么結構式&#xff1f;怎么繪制呢&#xff1f;可以用InDraw里的AI圖像識別這個結構式&#xff0c;也可以手動繪圖&#xf…