Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100"思路:时间复杂度O(n), 空间复杂度O(1) 1 class Solution { 2 pub...
分类:
其他好文 时间:
2014-11-04 22:35:25
阅读次数:
246
POJ 3358 Period of an Infinite Binary Expansion( 数论好题 + 欧拉定理 + 欧拉函数 )#include #include #include #include using namespace std;typedef long long LL;LL f...
分类:
其他好文 时间:
2014-11-04 21:07:26
阅读次数:
167
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total numb...
分类:
其他好文 时间:
2014-11-04 18:48:23
阅读次数:
187
题目描述:
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree is symmetric:
1
/ 2 2
/ \ / 3 4 4 3
...
分类:
其他好文 时间:
2014-11-04 17:24:06
阅读次数:
132
题目描述:
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the s...
分类:
其他好文 时间:
2014-11-04 11:09:10
阅读次数:
135
grep "key" xxx.log时输出
Binary file xxx.log matches
百度了一下:grep认为这是二进制文件,解决方案:grep -a。
grep -a "key" xxx.log...
分类:
其他好文 时间:
2014-11-04 11:07:12
阅读次数:
175
步骤1:下载Axis2
选择Standard Binary Distribution的zip包;解压到任一路径下
步骤2:配置Axis2
Window -> Preferences -> Web Service
步骤3:开发WebService
1)、新建一个Dynamic Web Project,命名为“WebService”
2)、新建...
分类:
Web程序 时间:
2014-11-04 09:26:53
阅读次数:
233
摘要 书中第10章10.4小节介绍了有根树,简单介绍了二叉树和分支数目无限制的有根树的存储结构,而没有关于二叉树的遍历过程。为此对二叉树做个简单的总结,介绍一下二叉树基本概念、性质、二叉树的存储结构和遍历过程,主要包括先根遍历、中根遍历、后根遍历和层次遍历。1、二叉树的定义 二叉树(Binary.....
分类:
其他好文 时间:
2014-11-04 00:09:42
阅读次数:
247
看了一下数据结构中树的操作,A这题感觉好一点了。Symmetric Tree和这个很相似来着,可以借鉴一下这个思路。用递归处理Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that ...
分类:
其他好文 时间:
2014-11-03 23:55:42
阅读次数:
184
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 1 /** 2 * Definition for singly-linked ....
分类:
其他好文 时间:
2014-11-03 23:53:07
阅读次数:
185