首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏皮皮星球

    Tree - 101. Symmetric Tree

    Symmetric Tree Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \ 3 4 4 3 But 思路: 题目意思是判断一棵树是不是对称的,可以用迭代或者递归来做 代码: go: /** * Definition for a binary tree node.

    93910发布于 2020-09-23
  • 来自专栏小白鼠

    Tree

    tree = new Tree(); tree.insert(2); tree.insert(1); tree.insert(7); tree.insert (5); tree.insert(4); tree.insert(6); tree.insert(10); tree.insert(8); tree.insert(11); tree.insert(9); // 查找 Node node = tree.find(6); -------------------------------"); tree.inOrder(tree.root); // 后序遍历 System.out.println -------------------------------"); tree.remove(7); tree.inOrder(tree.root); } }

    94220发布于 2018-08-21
  • 来自专栏小七的各种胡思乱想

    Tree - Decision Tree with sklearn source code

    Tree generally. Decision Tree Builder Ideally for a perfect tree, the tree leaf should have only 1 class for classification Decision Tree Stopping and pruning Now we know how to build the tree from top to the bottom, there is Take regression tree as an example: We define \(T \subset T_0\) as a sub tree, which reaches an optimal The higher it is, the smaller tree we will get.

    1K10发布于 2019-09-10
  • 来自专栏石头岛

    Merkle Tree、Merkle Patricia Tree

    前言 如果是接触区块链开发相关的话题,Merkle Tree 是一个必需要了解的话题。 BTC和ETH都使用这项技术,但是数据结构不同。 应用侧重点也不同。 用意 Merkle tree 图片 注意这里的虚线,最后的叶子节点是真正挂数据的节点。 Merkle Patricia Tree TODO 以太坊 Merkle Patricia Tree 应用 参考链接 https://en.wikipedia.org/wiki/Merkle_tree

    25810编辑于 2023-10-20
  • 来自专栏皮皮星球

    Tree - 100. Same Tree

    Same Tree Given two binary trees, write a function to check if they are the same or not. 代码: go: /** * Definition for a binary tree node.

    68020发布于 2020-09-23
  • 来自专栏运维猫

    tree

    所以,我找到了这个tree命令,很好用。一个tree命令,就可以列出对应的目录结构,方便了截图说明问题。 本文的测试环境是centos7.6,当然,在其它的类unix系统中。 都是可以安装使用这个tree命令的。使用方式大同小异。这个很好用的tree命令,可以用于查看文件夹结构。本文中简单介绍tree命令的基本使用方式。 1、安装tree 如果centos系统里面不存在tree命令,是不会提示unknown command的,而是提示下面的信息: [root@docker-01 ~]# tree -bash: tree: 安装完成后,目录路径为: [root@docker-01 ~]# which tree /usr/bin/tree 2、查看当前目录结构 在tree命令后,增加目录路径即可。 [root@docker-01 /]# tree ./ -f > tree.txt [root@docker-01 /]# head -n 5 tree.txt . ├── .

    1.3K20发布于 2019-09-23
  • 来自专栏前端儿

    Tree

    Tree 描述 Little Valentine liked playing with binary trees very much. For the tree drawn above the preorder traversal is DBACEGF and the inorder traversal is ABCDEFG.  She thought that such a pair of strings would give enough information to reconstruct the tree later ( two strings preord and inord, representing the preorder traversal and inorder traversal of a binary tree Input is terminated by end of file.输出For each test case, recover Valentine's binary tree and print one

    90220发布于 2018-09-03
  • 来自专栏皮皮星球

    Tree - 226. Invert Binary Tree

    Invert Binary Tree Invert a binary tree. \ 7 2 / \ / \ 9 6 3 1 思路: 递归求解翻转每个不为nil的节点 代码: go: /** * Definition for a binary tree

    68620发布于 2020-09-23
  • 来自专栏皮皮星球

    Tree - 110. Balanced Binary Tree

    Balanced Binary Tree Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the depth of the Example 1: Given the following tree [3,9,20,null,null,15,7]: 3 / \ 9 20 / \ 15 7 Example 2: Given the following tree [1,2,2,3,3,null,null,4,4]: 1 / \ 2 2 / \ 代码: go: /** * Definition for a binary tree node.

    52610发布于 2020-09-23
  • 来自专栏皮皮星球

    Tree - 257. Binary Tree Paths

    Binary Tree Paths Given a binary tree, return all root-to-leaf paths. 代码: go: /** * Definition for a binary tree node.

    56220发布于 2020-09-23
  • 来自专栏皮皮星球

    Tree - 145. Binary Tree Postorder Traversal

    Binary Tree Postorder Traversal Given a binary tree, return the postorder traversal of its nodes' values 代码: go: /** * Definition for a binary tree node.

    52810发布于 2020-09-23
  • 来自专栏皮皮星球

    Tree - 111. Minimum Depth of Binary Tree

    Minimum Depth of Binary Tree Given a binary tree, find its minimum depth. Example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 return its 代码: go: /** * Definition for a binary tree node.

    52520发布于 2020-09-23
  • 来自专栏米扑专栏

    BTree,B-Tree,B+Tree,B*Tree都是什么

           3.非叶子结点的左指针指向小于其关键字的子树,右指针指向大于其关键字的子树;

    82450发布于 2019-02-19
  • 来自专栏搬砖记录

    44 Binary Search Tree to Greater Sum Tree

    题目 Given the root of a binary search tree with distinct values, modify it so that every node has a new value equal to the sum of the values of the original tree that are greater than or equal to node.val As a reminder, a binary search tree is a tree that satisfies these constraints: The left subtree of a : [30,36,21,36,35,26,15,null,null,null,33,null,null,null,8] Constraints: The number of nodes in the tree The given tree is a binary search tree. 分析 题意:从右到左、下到上累加和,赋给当前节点。

    61230发布于 2021-08-18
  • 来自专栏皮皮星球

    Tree - 297. Serialize and Deserialize Binary Tree

    Serialize and Deserialize Binary Tree Serialization is the process of converting a data structure or Design an algorithm to serialize and deserialize a binary tree. to the original tree structure. **Example: ** You may serialize the following tree: 1 / \ 2 3 / \ 4 5 as "[1,2,3 ,null,null,4,5]" Clarification: The above format is the same as how LeetCode serializes a binary tree

    48010发布于 2020-09-23
  • 来自专栏calmound

    Same Tree

    问题:判断两棵二叉树是否相等 class Solution { public: bool isSameTree(TreeNode *p, TreeNode *q) { if(!( (p && q && p->val==q->val) || (p==NULL && q==NULL))) return false; if(p==NULL || q==NULL) return true; return isSameTree(p->left,q->left)

    63950发布于 2018-04-17
  • 来自专栏JNing的专栏

    tree指令

    安装tree库 sudo apt-get install tree ---- 查看tree的帮助文档 :~$ tree --help usage: tree [-acdfghilnpqrstuvxACDFQNSUX -R Rerun tree when max dir level reached. --noreport Turn off file/directory count at end of tree listing. --help Print usage and this help message and exit. ---- 操作举例 显示所有文件(不包括隐藏文件): tree   输出: . ├── -d   输出: . ├── Image_Generated ├── Image_Origin └── src 3 directories ---- 显示所有文件(包括隐藏文件): tree -a

    1.1K20发布于 2018-09-28
  • 来自专栏采云轩

    Tree Shaking

    什么是 Tree Shaking Tree-shaking (摇树) 是一个术语,通常指通过打包工具"摇"我们的代码,将未引用代码 (Dead Code) "摇" 掉。 Tree Shaking 具体做了什么 我们通过例子来详细了解一下 Webpack 中 Tree Shaking 到底做了什么 未使用的函数消除 // utils.js export function Tree Shaking 和 sideEffects 提到 Tree Shaking 就要聊一下 sideEffects。 使用支持 Tree Shaking 的包。 /guides/tree-shaking/)

    1K30编辑于 2022-12-01
  • 来自专栏皮皮星球

    Tree - 104. Maximum Depth of Binary Tree

    Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. Example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 return its 代码: go: /** * Definition for a binary tree node.

    40820发布于 2020-09-23
  • 来自专栏皮皮星球

    Tree - 173. Binary Search Tree Iterator

    Binary Search Tree Iterator Implement an iterator over a binary search tree (BST). 代码: go: /** * Definition for a binary tree node.

    44420发布于 2020-09-23
领券