Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only ...
分类:
其他好文 时间:
2017-10-20 13:41:37
阅读次数:
210
485. Max Consecutive Ones Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Solution1: ...
分类:
其他好文 时间:
2017-10-19 19:41:04
阅读次数:
226
Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example,Given n = 3, there are a total of 5 unique BST' ...
分类:
其他好文 时间:
2017-10-19 11:07:11
阅读次数:
129
题目链接:hdu 4010 Query on The Trees 题意: 给你一棵树,有4种操作。 1 连接x,y. 2 断开x,y. 3 将x到y这条路径加上一个值w. 4 询问x到y这条路径的最大值. 题解: LCT必做题,全是LCT操作。 1 #include<bits/stdc++.h> 2 ...
分类:
其他好文 时间:
2017-10-18 23:08:56
阅读次数:
259
service资源 service资源主要对服务做启动、重启、关闭,监控进程的状态等.service的参数:service{‘resourcetitle‘:
name=>#(namevar)Thenameoftheservicetorun.Thisnameis...
ensure=>#Whetheraserviceshouldberunning.Valid...
binary=>#Thepathtothedaemon.Thisiso..
分类:
其他好文 时间:
2017-10-18 20:10:51
阅读次数:
189
原题链接在这里:https://leetcode.com/problems/count-binary-substrings/description/ 题目: Give a string s, count the number of non-empty (contiguous) substrings ...
分类:
其他好文 时间:
2017-10-18 10:14:49
阅读次数:
163
Convert a binary search tree to doubly linked list with in-order traversal. Example Given a binary search tree: 4 / \ 2 5 / \ 1 3 return 1<->2<->3<->4 ...
分类:
其他好文 时间:
2017-10-18 10:13:56
阅读次数:
156
var_dump ( $arg1...); echo $arg1,$arg2...; base_convert(转换的数值, 该数值的进制,要转换成的进制) 各进制的英文: 二进制:binary 十进制:decimal 八进制:octect 十六进制:hexadecimal 返回 $str 字符串从 ...
分类:
Web程序 时间:
2017-10-18 01:45:58
阅读次数:
247
Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in th... ...
分类:
其他好文 时间:
2017-10-18 00:22:21
阅读次数:
153