LeetCode——二叉树(Java)

二叉树

  • 简介
  • [简单] 144. 二叉树的前序遍历、94. 二叉树的中序遍历、145. 二叉树的后序遍历
  • 二叉树层序遍历
    • [中等] 102. 二叉树的层序遍历
    • [中等] 107. 二叉树的层序遍历 II
    • [中等] 199. 二叉树的右视图
    • [简单] 637. 二叉树的层平均值
    • [中等] 429. N 叉树的层序遍历
    • [中等] 515. 在每个树行中找最大值
    • [中等] 116. 填充每个节点的下一个右侧节点指针、[中等]117. 填充每个节点的下一个右侧节点指针 II
    • [简单] 104. 二叉树的最大深度
    • [简单] 111. 二叉树的最小深度
  • [简单] 226. 翻转二叉树
  • [简单] 101. 对称二叉树
  • [简单] 100. 相同的树
  • [简单] 572. 另一棵树的子树
  • [简单] 222. 完全二叉树的节点个数
  • [简单] 110. 平衡二叉树
  • [简单] 257. 二叉树的所有路径
  • [简单] 404. 左叶子之和
  • [中等] 513. 找树左下角的值
  • [简单] 112. 路径总和
  • [中等] 113. 路径总和 II

简介

记录一下自己刷题的历程以及代码。写题过程中参考了 代码随想录的刷题路线。会附上一些个人的思路,如果有错误,可以在评论区提醒一下。
涉及:二叉树前中后序遍历、层序遍历、队列Queue、头插法、递归、ArrayList、LinkedList、递归、StringBuilder

[简单] 144. 二叉树的前序遍历、94. 二叉树的中序遍历、145. 二叉树的后序遍历

144. 二叉树的前序遍历
94. 二叉树的中序遍历
145. 二叉树的后序遍历

前中后序遍历可以公用一套递归思路,都是比较经典的模板:

//先序遍历
递归访问(){
    对节点做操作
    递归访问(左子树)
    递归访问(右子树)
}

//中序遍历
递归访问(){
    递归访问(左子树)
    对节点做操作
    递归访问(右子树)
}

//后序遍历
递归访问(){
    递归访问(左子树)
    递归访问(右子树)
    对节点做操作
}
  1. 二叉树的前序遍历
class Solution {
    public List<Integer> preorderTraversal(TreeNode root) {
        List<Integer> answer = new ArrayList<>();
        preorder(root, answer);
        return answer;
    }

    public void preorder(TreeNode root, List<Integer> answer){
        if(root == null) return;
        answer.add(root.val);
        preorder(root.left,answer);
        preorder(root.right,answer);
        return;
    }
}
  1. 二叉树的中序遍历
class Solution {
    public List<Integer> inorderTraversal(TreeNode root) {
        List<Integer> answer = new ArrayList<>();
        inorder(root, answer);
        return answer;
    }

    public void inorder(TreeNode root, List<Integer> answer){
        if(root == null) return;
        inorder(root.left,answer);
        answer.add(root.val);
        inorder(root.right,answer);
        return;
    }
}
  1. 二叉树的后序遍历
class Solution {
    public List<Integer> postorderTraversal(TreeNode root) {
        List<Integer> answer = new ArrayList<>();
        postorder(root, answer);
        return answer;
    }

    public void postorder(TreeNode root, List<Integer> answer){
        if(root == null) return;
        postorder(root.left,answer);
        postorder(root.right,answer);
        answer.add(root.val);
        return;
    }
}

二叉树层序遍历

[中等] 102. 二叉树的层序遍历

原题链接

经典的BFS
用队列保存树节点,每次统计队列的size(),也就是第n层节点数量。
处理这一层的节点,将其子节点全部加入队列,循环往复到队列为空。

class Solution {
    public List<List<Integer>> levelOrder(TreeNode root) {
        List<List<Integer>> ans = new ArrayList<List<Integer>>();
        Queue<TreeNode> queue = new ArrayDeque<>();
        if(root == null) return ans;
        queue.add(root);
        while(!queue.isEmpty()){
            List<Integer> nums = new ArrayList<Integer>();
            int k = queue.size();
            while(k-- > 0) {
                TreeNode temp = queue.remove();
                nums.add(temp.val);
                if (temp.left != null) queue.add(temp.left);
                if (temp.right != null) queue.add(temp.right);
            }
            ans.add(nums);
        }
        return ans;
    }
}

[中等] 107. 二叉树的层序遍历 II

原题链接

方法①:
与102的最基本的层序遍历相似的逻辑,使用递归的方法把每次ans.add(nums);操作顺序进行了倒序。

class Solution {
    public List<List<Integer>> levelOrderBottom(TreeNode root) {
        List<List<Integer>> ans = new ArrayList<List<Integer>>();
        Queue<TreeNode> queue = new ArrayDeque<>();
        if(root == null) return ans;
        queue.add(root);
        recursion(queue, ans);
        return ans;
    }

    public void recursion(Queue<TreeNode> queue, List<List<Integer>> ans){
        if(!queue.isEmpty()){
            List<Integer> nums = new ArrayList<Integer>();
            int k = queue.size();
            while(k-- > 0) {
                TreeNode temp = queue.remove();
                nums.add(temp.val);
                if (temp.left != null) queue.add(temp.left);
                if (temp.right != null) queue.add(temp.right);
            }
            recursion(queue, ans);
            ans.add(nums);
        }
        return;
    }
}

方法②:
使用LinkedList,用头插法的方式构造返回值。(LinkedList底层为链表,头插法比较方便,ArrayList底层是连续存储,头插法复杂度为O(n))

class Solution {
    public List<List<Integer>> levelOrderBottom(TreeNode root) {
        List<List<Integer>> ans = new LinkedList<>();
        Queue<TreeNode> queue = new ArrayDeque<>();
        if(root == null) return ans;
        queue.add(root);
        while(!queue.isEmpty()){
            List<Integer> nums = new ArrayList<Integer>();
            int k = queue.size();
            while(k-- > 0) {
                TreeNode temp = queue.remove();
                nums.add(temp.val);
                if (temp.left != null) queue.add(temp.left);
                if (temp.right != null) queue.add(temp.right);
            }
            ans.add(0, nums);
        }
        return ans;
    }

}

[中等] 199. 二叉树的右视图

原题链接

与102的最基本的层序遍历相似的逻辑,构建返回值时每次只把当前层最右边的数加入ans即可。

class Solution {
    public List<Integer> rightSideView(TreeNode root) {
        List<Integer> ans = new ArrayList<Integer>();
        Queue<TreeNode> queue = new ArrayDeque<>();
        if(root == null) return ans;
        queue.add(root);
        while(!queue.isEmpty()){
            List<Integer> nums = new ArrayList<Integer>();
            int k = queue.size();
            while(k-- > 0) {
                TreeNode temp = queue.remove();
                nums.add(temp.val);
                if (temp.left != null) queue.add(temp.left);
                if (temp.right != null) queue.add(temp.right);
            }
            ans.add((nums.get(nums.size()-1)));
        }
        return ans;
    }
}

[简单] 637. 二叉树的层平均值

原题链接

class Solution {
    public List<Double> averageOfLevels(TreeNode root) {
        Queue<TreeNode> queue = new ArrayDeque<>();
        List<Double> ans = new ArrayList<>();
        if(root == null) return ans;
        queue.add(root);
        while(!queue.isEmpty()){
            double num = 0;
            int k = queue.size();
            int i = k;
            while(k-- > 0){
                TreeNode temp = queue.remove();
                num += temp.val;
                if(temp.left != null) queue.add(temp.left);
                if(temp.right != null) queue.add(temp.right);
            }
            ans.add(num / i);
        }
        return ans;
    }
}

[中等] 429. N 叉树的层序遍历

原题链接

class Solution {
    public List<List<Integer>> levelOrder(Node root) {
        List<List<Integer>> ans = new ArrayList<List<Integer>>();
        Queue<Node> queue = new ArrayDeque<>();
        if(root == null) return ans;
        queue.add(root);
        while(!queue.isEmpty()){
            List<Integer> nums = new ArrayList<Integer>();
            int k = queue.size();
            while(k-- > 0) {
                Node temp = queue.remove();
                nums.add(temp.val);
                for(int i = 0; i < temp.children.size(); i++) {
                    queue.add(temp.children.get(i));
                }
            }
            ans.add(nums);
        }
        return ans;
    }
}

[中等] 515. 在每个树行中找最大值

原题链接

class Solution {
    public List<Integer> largestValues(TreeNode root) {
       List<Integer> ans = new ArrayList<>();
        Queue<TreeNode> queue = new ArrayDeque<>();
        if(root == null) return ans;
        queue.add(root);
        while(!queue.isEmpty()){
            int max = queue.peek().val;
            int k = queue.size();
            while(k-- > 0) {
                TreeNode temp = queue.remove();
                max = max > temp.val ? max : temp.val;
                if(temp.left != null) queue.add(temp.left);
                if(temp.right != null) queue.add(temp.right);
            }
            ans.add(max);
        }
        return ans;
    }
}

[中等] 116. 填充每个节点的下一个右侧节点指针、[中等]117. 填充每个节点的下一个右侧节点指针 II

[中等] 116. 填充每个节点的下一个右侧节点指针
[中等]117. 填充每个节点的下一个右侧节点指针 II
方法①:
正常的层序遍历,每层除了最后一个节点之外都对next赋值

class Solution {
    public Node connect(Node root) {
       List<Integer> ans = new ArrayList<>();
        Queue<Node> queue = new ArrayDeque<>();
        if(root == null) return root;
        queue.add(root);
        while(!queue.isEmpty()){
            int k = queue.size();
            while(k-- > 0) {
                Node temp = queue.remove();
                if(k > 0) {
                    temp.next = queue.peek();
                }
                if(temp.left != null) queue.add(temp.left);
                if(temp.right != null) queue.add(temp.right);
            }
            
        }
        return root;
    }
}

方法②:
使用next链接来对同层次节点做遍历,可以省去队列的开销
注意Node引用需要申请在方法外,不能做参数传递,java中都是值传递

class Solution {
    Node last = null, nextStart = null;
    public Node connect(Node root) {
        List<Integer> ans = new ArrayList<>();
        if(root == null) return root;

        Node p = root;
        while(p!=null){
            if(p.left != null){
                handle(p.left);
            }
            if(p.right != null){
                handle(p.right);
            }
            p = p.next;
            if(p == null && nextStart != null){
                p = nextStart;
                nextStart = null;
                last = null;
            }
        }
        return root;
    }

    public void handle(Node p){
        if(nextStart == null){
            nextStart = p;
        }
        if(last != null){
            last.next = p;
        }
        last = p;
    }

}

[简单] 104. 二叉树的最大深度

原题链接

方法①:层序遍历

class Solution {
    public int maxDepth(TreeNode root) {
        int depth = 0;
        if(root == null) return depth;
        Queue<TreeNode> queue = new ArrayDeque<>();
        queue.add(root);
        while(!queue.isEmpty()){
            depth++;
            int k = queue.size();
            while(k-- > 0) {
                TreeNode temp = queue.remove();
                if (temp.left != null) queue.add(temp.left);
                if (temp.right != null) queue.add(temp.right);
            }
        }
        return depth;
    }
}

方法②:递归
树的高度就是 其子树的最大高度 + 1,用在多叉树上也是一样的思路

class Solution {
    public int maxDepth(TreeNode root) {
        if(root == null) return 0;
        int leftDepth = maxDepth(root.left);
        int rightDepth = maxDepth(root.right);
        return (leftDepth > rightDepth ? leftDepth : rightDepth) + 1;
    }
}

[简单] 111. 二叉树的最小深度

原题链接
方法①:层序遍历找左右子树皆空的点即可

class Solution {
    public int minDepth(TreeNode root) {
        int depth = 0;
        if(root == null) return depth;
        Queue<TreeNode> queue = new ArrayDeque<>();
        queue.add(root);
        while(!queue.isEmpty()){
            depth++;
            int k = queue.size();
            while(k-- > 0) {
                TreeNode temp = queue.remove();
                if(temp.left == null && temp.right == null) return depth;
                if (temp.left != null) queue.add(temp.left);
                if (temp.right != null) queue.add(temp.right);
            }
        }
        return depth;
    }
}

方法②:递归求解
用递归求解记住需要的是到叶子节点的深度
如果非叶子节点,假设只有单边左子树,右子数应当是找不到叶子节点也就是距离无穷大,可以设置一个Integer.MAX_VALUE做为返回值,这样通过比较,递归的上一层就会获得左子树找到叶子节点的最小距离 + 1

class Solution {
    public int minDepth(TreeNode root) {
        if(root == null) return 0;
        if(root.left == null && root.right == null) return 1;
        int leftMin = Integer.MAX_VALUE;
        int rightMin = Integer.MAX_VALUE;
        if(root.left != null) leftMin = minDepth(root.left);
        if(root.right != null) rightMin = minDepth(root.right);
        return (leftMin < rightMin ? leftMin : rightMin) + 1;
    }
}

[简单] 226. 翻转二叉树

原题链接

前序遍历的基础上每一次遍历节点做翻转操作。
切记前序、后续、层次遍历都可以,但是不可以是中序遍历,因为中序遍历是左 中 右 的顺序,递归调整左子树之后,处理当前节点会把左右子树对调,这样进入右子数递归时其实还是对原先的左子树做操作。

class Solution {
    public TreeNode invertTree(TreeNode root) {
        preorder(root);
        return root;
    }

    public void preorder(TreeNode root){
        if(root == null) return;
        TreeNode temp = root.left;
        root.left = root.right;
        root.right = temp;
        preorder(root.left);
        preorder(root.right);
        return;
    }
}

[简单] 101. 对称二叉树

原题链接

经典的递归思路,对左右子树做反方向的递归即可,在左子树上做前序遍历,每次递归left的左节点时就去递归right的右节点,递归left的右节点时则递归right的左节点。

class Solution {
    public boolean isSymmetric(TreeNode root) {
        if(root == null) return true;
        TreeNode left = root.left;
        TreeNode right = root.right;
        return recursion(left, right);
    }

    public boolean recursion(TreeNode left, TreeNode right){
        if(left == null && right == null)
            return true;
        else if(left != null && right != null) {
            if (left.val != right.val)
                return false;
            if (recursion(left.left, right.right) && recursion(left.right, right.left))
                return true;
        }
        return false;
    }
}

[简单] 100. 相同的树

原题链接

两棵树同频做前序遍历即可,其他遍历方式也是ok的。

class Solution {
    public boolean isSameTree(TreeNode p, TreeNode q) {
        return recursion(p, q);
    }

    public boolean recursion(TreeNode p, TreeNode q){
        if(p == null && q == null)
            return true;
        else if(p != null && q != null) {
            if (p.val != q.val)
                return false;
            if (recursion(p.left, q.left) && recursion(p.right, q.right))
                return true;
        }
        return false;
    }
}

[简单] 572. 另一棵树的子树

原题链接

两层递归
①preorder:对root 的前序遍历,找到与subRoot相同值的节点,作为比较的起点②cmprecursion:对root的节点以及subRoot的根节点 做 同频前序遍历对比

class Solution {
    public boolean isSubtree(TreeNode root, TreeNode subRoot) {
        if(subRoot == null) return true;
        if(root == null) return true;
        return preorder(root, subRoot);
    }

    public boolean preorder(TreeNode p, TreeNode q){
        if(p == null) return false;
        if(p.val == q.val && cmprecursion(p, q))
            return true;
        if(preorder(p.left, q) || preorder(p.right, q)) 
            return true;
        return false;
    }

    public boolean cmprecursion(TreeNode p, TreeNode q){
        if(p == null && q == null) 
            return true;
        else if(p != null && q != null){
            if(p.val != q.val) 
                return false;
            if(cmprecursion(p.left, q.left) && cmprecursion(p.right, q.right))
                return true;
        }
        return false;
    }
}

[简单] 222. 完全二叉树的节点个数

原题链接

递归

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

[简单] 110. 平衡二叉树

原题链接

递归,后序遍历
用-2标记 以当前节点为根节点的子树非平衡二叉树,在递归中一旦出现-2就层层传递到root,用来标识存在子树为非平衡二叉树

class Solution {
    public boolean isBalanced(TreeNode root) {
        if(countDepth(root) == -2) return false;
        return true;
    }

    public int countDepth(TreeNode p){
        if(p == null) return 0;
        int leftDepth = countDepth(p.left);
        int rightDepth = countDepth(p.right);
        int flag = leftDepth - rightDepth;
        if(leftDepth == -2 || rightDepth == -2 || flag > 1 || flag < -1) return -2;
        else return (leftDepth > rightDepth ? leftDepth : rightDepth) + 1;
    }
}

[简单] 257. 二叉树的所有路径

原题链接

思路就是DFS深度优先遍历找到每一条路径,效率差异主要体现在对字符串拼接的处理上,使用StringBuilder会更高效一些。
在这里插入图片描述

class Solution {
    public List<String> binaryTreePaths(TreeNode root) {
        List<String> ans = new ArrayList<>();
        if(root == null) return ans;
        DFS(root, ans, "");
        return ans;
    }

    public void DFS(TreeNode p, List<String> ans, String string){
        StringBuilder sb = new StringBuilder(string);
        sb.append(p.val);
        if(p.left == null && p.right == null){
            ans.add(sb.toString());
            return;
        }
        sb.append("->");
        if(p.left != null)
            DFS(p.left, ans, sb.toString());
        if(p.right != null)
            DFS(p.right, ans, sb.toString());
    }
}

[简单] 404. 左叶子之和

原题链接

在前序遍历的基础上更改,用一个布尔类型标记当前节点是否是某个节点的左孩子

class Solution {
    public int sumOfLeftLeaves(TreeNode root) {
        int sum = preorder(root, false, 0);
        return sum;
    }

    public int preorder(TreeNode root, boolean isLChild, int sum) {
        if (root == null) return sum;
        if (root.left == null && root.right == null && isLChild){
            return sum + root.val;
        }
        return preorder(root.left, true, sum) + preorder(root.right, false, sum);
    }
}

[中等] 513. 找树左下角的值

原题链接

最容易想到就是层序遍历,每层都记录 队列头的值即可

class Solution {
    public int findBottomLeftValue(TreeNode root) {
        Queue<TreeNode> queue = new ArrayDeque<>();
        int ans = root.val;
        queue.add(root);
        while(!queue.isEmpty()){
            int k = queue.size();
            ans = queue.peek().val;
            while(k-- > 0) {
                TreeNode temp = queue.remove();
                if (temp.left != null) queue.add(temp.left);
                if (temp.right != null) queue.add(temp.right);
            }
        }
        return ans;
    }
}

方法②:稍微绕一些,使用前序遍历,每次碰到新的maxDepth,都是左子树先,所以,只要碰到新的最大深度就可以更新返回值

class Solution {
    int maxDepth = -1;
    int value = 0;

    public int findBottomLeftValue(TreeNode root) {
        preorder(root, 0);
        return value;
    }

    public void preorder(TreeNode node, int depth) {
        // 终止条件: 遇到叶子结点就可以return了。
        // 并且:当遇到叶子节点的时候,就需要统计一下最大的深度了,所以需要遇到叶子节点来更新最大深度。
        if (node.left == null && node.right == null) {
            if (maxDepth < depth) {
                maxDepth = depth;
                value = node.val;
            }
            return;
        }

        // 递归遍历左子树
        if (node.left != null) {
            preorder(node.left, depth + 1);
        }

        // 递归遍历右子树
        if (node.right != null) {
            preorder(node.right, depth + 1);
        }
    }
}

[简单] 112. 路径总和

原题链接

前序遍历,记得总和与目标值相当时还需要判断是否是叶子节点,否则并不是一组答案

class Solution {
    public boolean hasPathSum(TreeNode root, int targetSum) {
        return preOrder(root, 0 ,targetSum);
    }

    public boolean preOrder(TreeNode root, int sum, int targetSum){
        if(root == null) return false;
        sum = sum + root.val;
        if(sum == targetSum && root.left == null && root.right == null)
            return true;
        if(preOrder(root.left, sum, targetSum)) return true;
        if(preOrder(root.right, sum, targetSum)) return true;
        return false;
    }
}

[中等] 113. 路径总和 II

原题链接

前序遍历,记得总和与目标值相当时还需要判断是否是叶子节点,否则并不是一组答案

class Solution {
    public List<List<Integer>> pathSum(TreeNode root, int targetSum) {
        List<List<Integer>> ans = new ArrayList<>();
        List<Integer> answer = new ArrayList<>();
        preOrder(root, ans, answer, 0, targetSum);
        return ans;
    }

    public void preOrder(TreeNode root, List<List<Integer>> ans, List<Integer> answer, int sum, int targetSum){
        if(root == null) return;
        sum = sum + root.val;
        answer.add(root.val);
        if(sum == targetSum && root.left == null && root.right == null)
            ans.add(new ArrayList<>(answer));
        preOrder(root.left, ans, answer, sum, targetSum);
        preOrder(root.right, ans, answer, sum, targetSum);
        answer.remove(answer.size() - 1);
    }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/434614.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

异地组网搭建方案

在这个信息爆炸的时代&#xff0c;人与人之间的联系变得越来越密切&#xff0c;而异地组网搭建方案也因此变得越 来越重要。无论是跨国企业、远程学习还是国际合作&#xff0c;构建一个快捷稳定的异地组网系统&#xff0c;已经 成为许多组织和个人不可或缺的需求。接下来&#…

强大的ps 命令 -o 自定义输出内容选项

强大的ps 命令 -o 自定义输出内容选项 1、ps命令介绍和作用2、问题描述 1、ps命令介绍和作用 ps 是一个 Unix 和类 Unix 操作系统中常用的命令&#xff0c;用于显示当前运行的进程信息。ps 命令的作用包括&#xff1a; 查看进程信息&#xff1a; ps 命令可以列出当前系统中正…

Matlab代码批处理全国地面气象站点日值数据集(2400站点数据集)

气象数据一直是一个价值较高的数据&#xff0c;它被广泛用于各个领域的研究当中。气象数据包括有气温、气压、相对湿度、降水、蒸发、风向风速、日照等多种指标&#xff0c;但是包含了这些全部指标的气象数据却较难获取&#xff0c;即使获取到了也不能随意分享。 1级目录 文件…

建站人的心酸:发了个官网加固通知,有公司关门的,还有吐槽的。

最近客户网站不是老被攻击么&#xff0c;所有节前发了个网站加固的通知&#xff0c;大部分客户都能理解和支持&#xff0c;也有客户倒闭的&#xff0c;也有想省钱结果费钱的&#xff0c;还有吐槽的。 尊敬的客户&#xff1a; 鉴于近期网络攻击频发&#xff0c;导致少部分客户…

可配置输入参数的接口如何设计

个人博客&#xff1a;无奈何杨&#xff08;wnhyang&#xff09; 个人语雀&#xff1a;wnhyang 共享语雀&#xff1a;在线知识共享 Github&#xff1a;wnhyang - Overview 作为程序员&#xff0c;我们绝大多数场景需要根据业务需求来设计系统&#xff0c;开发后端接口&#x…

java微服务技术选型,Java学习的三个终极问题及学习路线规划

前言 在网络技术中基于浏览器的B/S结构无论在PC端还是手机端都充当着至关重要的角色。 PC端自不必说&#xff0c;手机中很多应用虽然是以APP的形式存在&#xff0c;但它采用的还是B/S结构。如今日头条、微信的朋友圈等&#xff0c;这些应用在内部封装了浏览器&#xff0c;后端…

mysql 时间精度问题

timestamp到2038年&#xff0c;还有14年时间&#xff0c;一个系统如果能活到那一刻也是相当不错了。 这里先看一下个datetime的问题,下面的插入数据的时间戳是2024-03-06 21:20:50.839 INSERT INTO psi_io_balance ( id, as_id, bill_date, order_id, busi_type, direction, c…

二分查找算法:高效搜索有序数据的利器

二分查找算法&#xff1a;高效搜索有序数据的利器 在计算机科学中&#xff0c;搜索是一项基本而重要的操作。对于有序数据&#xff0c;二分查找算法是一种高效的搜索方法。本文将介绍二分查找算法的原理、实现以及其在实际应用中的优势&#xff0c;帮助读者理解和应用这一常用的…

最强AI Claude 3有意识了?四个问题看出和ChatGPT差距

原文&#xff1a;赵侠客 前言 sora的热点还没有褪去&#xff0c;这两天又大火了Clude3&#xff0c;有的说超越GPT-4&#xff0c;还有的说有意识了&#xff0c;连马斯克都说人类也是文件也。我们这些吃瓜群众看着AI每隔几天一个热点&#xff0c;心理素质差的人有可能越来越焦虑…

飞塔防火墙开局百篇——002.FortiGate上网配置——WAN口配置PPPoE上网/拨号宽带上网

WAN口配置IP上网 修改wan口配置 修改wan口配置 登陆FortiGate防火墙界面&#xff0c;配置中文界面。 点击网络点击接口点击接口模式&#xff0c;选择PPPoE配置用户名&#xff08;eq.123456163.gd&#xff09;和密码(运营商提供)单击确认 欢迎关注个人公众号&#xff0c;采购设…

自动化测试的定位及一些思考

大家对自动化的理解&#xff0c;首先是想到Web UI自动化&#xff0c;这就为什么我一说自动化&#xff0c;公司一般就会有很多人反对&#xff0c;因为自动化的成本实在太高了&#xff0c;其实自动化是分为三个层面的&#xff08;UI层自动化、接口自动化、单元测试&#xff09;&a…

FC-AE-1553 协议

FC-AE-1553 协议 MIL-STD-1553B总线协议总线结构字格式消息传输方式 FC协议FC协议栈拓扑结构服务类型帧/序列/交换FC帧格式 FC-AE-1553网络构成帧类型命令帧状态帧数据帧 Information UnitsNC1NC2NC3-4NC5-7NT1-7 传输模式1. NC-NT2. NT-NC3. NT-NT4. 无数据字的模式命令5. 带数…

Android开发必须要会,android性能优化面试

前言 前一段时间和一些大牛们交流了一下&#xff0c;据反馈现在Android岗位也没有以前那么多了&#xff0c;没这么好找了&#xff0c;寒冬季节&#xff0c;大量公司模仿O2O模式导致死掉企业的很多&#xff0c;导致供大于求&#xff0c;当然这不意味着饱和&#xff0c;只是市场…

中文版国产Figma简单好上手

在过去的两年里&#xff0c;国内外协同办公室发展迅速。一方面&#xff0c;它是由突如其来的疫情推动的&#xff0c;另一方面&#xff0c;它是科学技术不断进步的必然结果。在市场的推动下&#xff0c;市场上出现了越来越多的协同办公软件&#xff0c;使工作场所的工作更加高效…

门电路加法器乘法器

前言 大家好我是jiantaoyab&#xff0c;这是我所总结作为学习的笔记第六篇,在这里分享给大家,还有一些书籍《深入理解计算机系统》《计算机组成&#xff1a;结构化方法》《计算机体系结构&#xff1a;量化研究方法》《程序员的自我修养》&#xff0c;今天我们来了解门电路,加法…

保留数据的重装系统教程!(win10系统)

上车警告&#xff01;&#xff01;&#xff01; 本教程无需思考&#xff0c;跟着操作一步一步来就能完成系统的重装。原理是将C盘系统重装&#xff0c;其他盘符数据保存。适用于系统盘重装数据或更改系统版本。 重要提示&#xff01;&#xff01;&#xff01; C盘有重要学习资…

【OpenAI Triton】理解矩阵乘法中的super-grouping 21a649eddf854db5ad4c7753afb7cb72

【OpenAI Triton】理解矩阵乘法中的super-grouping 前言 最近做推理加速&#xff0c;会涉及一些底层算子的工作&#xff0c;老早就听说triton写算子比较方便&#xff0c;最近正好有一些应用场景&#xff0c;就根据官方文档和大佬们的见解记录一下自己的所学所得&#xff1b; …

CMake-深入理解find_package()的用法

前言&#xff1a; CMake给我们提供了find_package()命令用来查找依赖包&#xff0c;理想情况下&#xff0c;一句find_package()命令就能把一整个依赖包的头文件包含路径、库路径、库名字、版本号等情况都获取到&#xff0c;后续只管用就好了。但实际使用过程可能会出现这样那样…

#微信小程序创建(获取onenet平台数据)

1.IDE&#xff1a;微信开发者工具 2.实验&#xff1a;创建一个小程序&#xff08;http get获取onenet平台数据&#xff09; 3.记录&#xff1a; 百度网盘链接&#xff1a;https://pan.baidu.com/s/1eOd-2EnilnhPWoGUMj0fzw 提取码: 2023 &#xff08;1&#xff09;新建一个工…

【工具相关】zentao用例管理平台部署实践

文章目录 一、备份还原1、数据备份1.1、前言1.2、版本备份1.3、数据备份 2、数据恢复2.1、版本恢复2.2、数据恢复 二、问题处理1、ERROR: SQLSTATE[HY000] [2002] Connection refused 一、备份还原 1、数据备份 1.1、前言 禅道系统从10.6版本以后&#xff0c;新增数据备份设…
最新文章