题目: 二叉树的后序遍历:给定一个二叉树,返回它的 后序 遍历。 思路: 递归大法好,之后补充使用栈来实现的。 程序1:递归实现 # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # sel ...
分类:
编程语言 时间:
2020-05-15 20:29:29
阅读次数:
88
题目: 二叉树的前序遍历:给定一个二叉树,返回它的 前序 遍历。 思路: 思路一使用老套路递归,思路二会补充使用栈的程序。 程序1:递归 # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # ...
分类:
编程语言 时间:
2020-05-15 18:33:37
阅读次数:
63
In graph theory, a caterpillar or caterpillar tree is a tree in which all the vertices are within distance 1 of a central path. The central path can b ...
分类:
其他好文 时间:
2020-05-15 18:05:19
阅读次数:
77
前言:索引是MySQL数据库中的重要对象之一,索引的目的在于提高查询效率。可以类比字典中的目录,查找字典内容时可以根据目录查找到数据的存放位置,然后直接获取即可。索引是表的目录,在查找内容之前可以先在目录中查找索引位置,以此快速定位查询数据。需要说明的是,MySQL支持诸多存储引擎,而各种存储引擎对索引的支持也各不相同。为了避免混乱,本文将只关注于InnoDB引擎下的B+Tree索引。1.索引结构
分类:
数据库 时间:
2020-05-15 17:35:10
阅读次数:
68
z-tree官方文档: http://www.treejs.cn/v3/api.php 1. ztree获取当前选中节点及所有父节点 获得当前选中节点路径,如部门库〉新闻部〉文字稿: 树如下图: var curLocation="";//当前位置 var treeObj = $.fn.zTree.g ...
分类:
其他好文 时间:
2020-05-15 15:29:08
阅读次数:
54
Implement a trie with insert, search, and startsWith methods. Example: Trie trie = new Trie(); trie.insert("apple"); trie.search("apple"); // returns ...
分类:
其他好文 时间:
2020-05-15 09:27:43
阅读次数:
54
Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums. If target exists, ...
分类:
其他好文 时间:
2020-05-15 09:23:28
阅读次数:
56
https://leetcode-cn.com/problems/successor-lcci/ 这个题不是特别难,就是比较绕,按照中序遍历的当前节点的下一个结点分为两种 1.当前节点有右孩子,这种比较简单,直接找到右孩子的最左边的孩子就可以。 2.当前节点没有右孩子,要找到当前节点是父节点的左孩子 ...
分类:
其他好文 时间:
2020-05-14 22:41:44
阅读次数:
77
题目 A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find ...
分类:
其他好文 时间:
2020-05-14 19:42:49
阅读次数:
68
color: #666666; font-size: 16px; line-height: 22px; margin-top: 15px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-cl ...
分类:
Web程序 时间:
2020-05-14 19:41:59
阅读次数:
144