1.1 原始人冒泡排序 function bubbleSort(arr) { var len = arr.length; for (var i = 0; i < len; i++) { for (var j = 0; j < len - 1 - i; j++) { if (arr[j] > arr[ ...
分类:
编程语言 时间:
2019-04-27 12:57:58
阅读次数:
131
二叉树的先序/中序/后序遍历递归/非递归实现,讲的很清楚,其中后序遍历和先序中序的处理有些不一样: https://blog.yangx.site/2016/07/22/Python-binary-tree-traverse/ ...
分类:
其他好文 时间:
2019-04-27 12:49:47
阅读次数:
100
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes ...
分类:
其他好文 时间:
2019-04-26 22:52:19
阅读次数:
107
遍历二叉树 traversing binary tree 线索二叉树 threaded binary tree 线索链表 线索化 二叉树3个基本单元组成:根节点、左子树、右子树 以L、D、R分别表示遍历左子树、访问根节点、遍历右子树 可能的情况6种 排列A3 2 LDR LRD DLR DRL RL ...
分类:
其他好文 时间:
2019-04-26 13:11:05
阅读次数:
136
Return any binary tree that matches the given preorder and postorder traversals. Values in the traversals pre and post are distinct positive integers. ...
分类:
其他好文 时间:
2019-04-26 10:59:00
阅读次数:
182
Consider all the leaves of a binary tree. From?left to right order, the values of those?leaves form a leaf value sequence. For example, in the given t ...
分类:
其他好文 时间:
2019-04-26 00:43:52
阅读次数:
177
C++ STL中的Binary search(二分查找) 这篇博客转自爱国师哥,这里给出连接https://www.cnblogs.com/aiguona/p/7281856.html 一.解释 以前遇到二分的题目都是手动实现二分,不得不说错误比较多,关于返回值,关于区间的左闭右开等很容易出错,最近 ...
分类:
编程语言 时间:
2019-04-25 00:54:42
阅读次数:
113
题目如下: We run a preorder depth first search on the root of a binary tree. At each node in this traversal, we output D dashes (where D is the depth of t ...
分类:
其他好文 时间:
2019-04-24 23:36:24
阅读次数:
187
搞不定这种递归计算,可能我的头脑是“线性”的,这种一层一层的,想起来太费劲了,想的头发都没了。以后希望能有AI来写这种程序吧,AI不怕掉头发! 参考:https://leetcode.com/problems/distribute-coins-in-binary-tree/discuss/22193 ...
分类:
其他好文 时间:
2019-04-23 19:13:51
阅读次数:
105
L73 binary_remote_addr 对端二进制IPV4或IPV6 一般用作限制用户请求缓存key connection 递增链接序号 connection_requests 一条TCP链接上的请求数量 remote_addr 字符串格式IP地址 remote_port 字符串格式对端端口 ...
分类:
Web程序 时间:
2019-04-23 17:42:15
阅读次数:
183