#!/usr/bin/env pythonimport wxclass MainWindow(wx.Frame): def __init__(self, parent, title): wx.Frame.__init__(self, parent, title=title, si...
分类:
其他好文 时间:
2014-07-07 17:37:18
阅读次数:
142
Problem Description:Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your alg...
分类:
其他好文 时间:
2014-07-07 15:47:17
阅读次数:
272
题目
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note: You can only move either down...
分类:
其他好文 时间:
2014-06-30 11:10:34
阅读次数:
211
在代码的deletegater中写:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScre...
分类:
其他好文 时间:
2014-06-30 10:48:04
阅读次数:
240
【题目】
Given a binary tree, return the postorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [3,2,1].
Note: Recursive solution is trivial, could you do it iteratively?
【题意】
非递归实现后续遍...
分类:
其他好文 时间:
2014-06-30 10:10:10
阅读次数:
177
只是一个简单的小实验,对比了下 延迟绑定 和 非延迟的效率
延迟绑定主要就是使用 static 关键字来替代原来的 self ,但功能非常强大了
实验代码:
class A {
protected static $cc1 = array('a1', 'b', 'c', 'd');
protected static $cc2 = array('a2', 'b', 'c', 'd')...
分类:
Web程序 时间:
2014-06-30 08:46:02
阅读次数:
183
【题目】
Given a binary tree, return the preorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,2,3].
Note: Recursive solution is trivial, could you do it iteratively?
【题意】
非递归返回先序遍历...
分类:
其他好文 时间:
2014-06-30 06:21:18
阅读次数:
334
【题目】
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
【题意】
给定一个整数以外,其中除了一个整数只出现一次以外...
分类:
其他好文 时间:
2014-06-29 22:52:35
阅读次数:
246
1.如何设置tableview每行之间的分割线self.table.separatorStyle=UITableViewCellSeparatorStyleSingleLine;2.如何让cell能够响应select,但是选中后的颜色又不发生改变呢,那么就设置法一:完全不变色cell.selectionStyle=UITableViewCellSelectionStyleNone;法二:变下色马..
分类:
其他好文 时间:
2014-06-29 21:51:09
阅读次数:
362
看下面这段代码:#-*-coding:utf-8-*-importcopyclassPresent(object):def__init__(self,str_cmd):self._str_cmd=str_cmdprint"进入Present时的地址:",id(self._str_cmd)defset_value(self):temp="test_cmd"self._str_cmd=copy.deepcopy(temp)defget_value(self):returnself._s..
分类:
编程语言 时间:
2014-06-29 21:38:46
阅读次数:
318