• 0626微软he


    1 印度人说array size不能变
    3中国人抬一手,其实我不会
    4 lc原题19,我瞎查了个gfg就回答了,结果太复杂了,自己写的,就不完美吧。两个指针先后n我都忘了(捂脸)
    -其实题目很简单,没必要复习很复杂的东西。可是我是真的手生了。算了我还是回去工作吧。有经历以后,bq真的自然多了。
    工作请假,提心吊胆,担心受怕,还是算了吧。我胆小,我怂批。起码不要和开会时间撞车吧。。

    我旷工面试就勤奋了吗?就高尚了吗?
    认清自己的水平不行也挺好的:死记硬背的东西不是自己的,一段时间不碰就手生。

    不能死记硬背所以呢 起码挂的题记住。也未必还需大量面试的磨练,哪怕不面试,就重复做几遍也好。要多练习才会理解。
    所以要保持勤劳,想面的公司就面一面。消磨时间也挺好的。贱逼苦码农,死书呆子️,一辈子学习的命!
    priority:找对象先,再面试。

    using System;
    
    namespace Solution
    {
    public class TreeNode {
    public int val;
    public TreeNode left;
    public TreeNode right;
    public TreeNode(int x) { val = x; }
    }
    
    public class Solution {
    public const int Threshold = 6;
    public static TreeNode PruneTree(TreeNode root) {
    if (root == null) {
    return root;
    }
    
    root.left = PruneTree(root.left);
    root.right = PruneTree(root.right);
    
    // both children have been handled.
    // determine whether this node needs to be cut or not.
    // cut or return the node;
    //1.both null 2.one null 3.both not null
    if (root.left == null && root.right == null) {
    //compare root with Threshold
    if (root.val < Threshold) return null;
    else return root;
    }else if (root.left == null && root.right != null) {
    return root;
    }else if (root.left != null && root.right == null){
    return root;
    }else {
    return root;
    }
    }
    
    public static void PrintTree(TreeNode t, int parentValue) {
    if (t == null) {
    Console.WriteLine($"N from {parentValue}");
    return;
    }
    Console.WriteLine(t.val);
    PrintTree(t.left, t.val);
    PrintTree(t.right, t.val);
    }
    public static void Main(string[] args) {
    var root = new TreeNode(7);
    root.left = new TreeNode(2);
    root.left.left = new TreeNode(5);
    root.left.right = new TreeNode(4);
    root.right = new TreeNode(9);
    root.right.left = new TreeNode(3);
    root.right.right = new TreeNode(1);
    root.right.left.left = new TreeNode(10);
    PrintTree(root, int.MinValue);
    Console.WriteLine("*******");
    root = PruneTree(root);
    PrintTree(root, int.MinValue);
    }
    
    //compare
    public void recursion(TreeNode node) {
    //end
    if (node.val < Threshold)
    //cut function
    
    
    //compare
    recursion(node.left);
    recursion(node.right);
    }
    
    //cut
    
     
    
    
    }
    }
     
  • 相关阅读:
    条码的开发使用介绍文档
    identity server4
    IUrlHelper ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
    netcore 版本 切换 sdk
    深层目录文件复制,C# 递归,录音录像图片文件过多,用于测试程序
    C# int uint long ulong byte sbyte float double decimal 范围,及类型!
    sqlserver 数据类型 C# clr 数据类型 映射
    Unable to resolve service for type 'Microsoft.Extensions.Logging.ILogger' while attempting to activate 'xxxxx.Controllers.xxxxController'.
    identity 基础表没有创建 aspnetuserclaims aspnetuserlogins
    DatabaseGeneratedOption
  • 原文地址:https://www.cnblogs.com/immiao0319/p/16423086.html
Copyright © 2020-2023  润新知