Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
题目并不复杂,以下是我的程序,后面是别人的程序,瞬间low了好大一截!
冗长!!!!!!!class Solution {
public:
s...
分类:
其他好文 时间:
2015-07-29 01:08:13
阅读次数:
133
BitmapFactory.Options options=new BitmapFactory.Options();
options.inJustDecodeBounds = false;
options.inSampleSize = 10; //width,hight设为原来的十分一
return BitmapFactory.decodeFile(imgPath,opt...
分类:
其他好文 时间:
2015-07-29 01:01:43
阅读次数:
92
函数名: exit()所在头文件:stdlib.h(如果是”VC6.0“的话头文件为:windows.h)功 能: 关闭所有文件,终止正在执行的进程。exit(1)表示异常退出.这个1是返回给操作系统的。exit(x)(x不为0)都表示异常退出exit(0)表示正常退出exit()的参数会被传递给一...
分类:
其他好文 时间:
2015-07-29 00:45:19
阅读次数:
86
题目:
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a deep copy of the list.
解题:
这题是要复制一个链表,这个链表比...
分类:
编程语言 时间:
2015-07-28 23:17:43
阅读次数:
583
Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are+, - and *.
Example 1
I...
分类:
其他好文 时间:
2015-07-28 23:10:46
阅读次数:
155
Given a collection of integers that might contain duplicates, nums, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.The solution set must not contain du...
分类:
其他好文 时间:
2015-07-28 23:09:23
阅读次数:
131
equals()方法是根类Object中的一个方法,子类可以根据需要重写该方法(比如:String类)。一、Object类中的equals()方法实现如下:1 public boolean equals(Object obj) {2 return (this == obj);...
分类:
其他好文 时间:
2015-07-28 22:56:36
阅读次数:
142
再实现通讯录的时候,需要把联系人按照A-Z的顺序排列这里就需要得到每个联系人的吗名字拼音下面这三个方法很有用处 1 /** 2 * 获取汉字串拼音,英文字符不变 3 * @param chinese 汉字串 4 * @return 汉语拼音 5 */ 6 public static Strin...
分类:
其他好文 时间:
2015-07-28 22:44:44
阅读次数:
155
BlockBlock类型无参数无返回值block自己不会执行,必须调用才会执行block大括号里的代码段 void (^block)() = ^(){
NSLog(@"无参数");
};
block();结果2015-07-28 20:06:56.839 OC10_Block[3182:202852] 无参数无参数有返回值有返回值在最后段要加上return...
分类:
其他好文 时间:
2015-07-28 21:10:11
阅读次数:
103
写一个函数,输入一个二叉树,树中每个节点存放了一个整数值,函数返回这棵二叉树中相差最大的两个节点间的差值绝对值。package alibaba.a0727;public class Demo01 {
int maxValue(BinNode root){
if(root == null)
return 0;//其实应该返回最小负整数,这里假设0为...
分类:
其他好文 时间:
2015-07-28 21:04:32
阅读次数:
130