function checkmemory%Copyright (c) 2014,Lv Qi%All
rights reserved.%%Redistribution and use in source and binary forms, with or
without modification, a...
分类:
其他好文 时间:
2014-05-10 20:07:52
阅读次数:
413
Given a binary tree containing digits from 0-9
only, each root-to-leaf path could represent a number.An example is the
root-to-leaf path 1->2->3 which...
分类:
其他好文 时间:
2014-05-05 23:55:36
阅读次数:
407
Given two binary strings, return their sum
(also a binary string).For example,a ="11"b
="1"Return"100".思路:一个二进制字符串相加;首先从字符串的末尾开始,先二进制字符转化为数字,然后再相加;然后将...
分类:
其他好文 时间:
2014-05-05 23:10:15
阅读次数:
319
1. 自定义验证--成功提示
1) 添加选项
errorClass: "unchecked",
validClass: "checked",
errorElement: "span",
errorPlacement: function (error, element) {
if (element.parent().find("span[for=""" + element.attr("id...
分类:
Web程序 时间:
2014-05-02 18:38:21
阅读次数:
467
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 n...
分类:
其他好文 时间:
2014-05-02 15:03:57
阅读次数:
386
Given a binary tree, determine if it is
height-balanced.For this problem, a height-balanced binary tree is defined as a
binary tree in which the depth...
分类:
其他好文 时间:
2014-05-02 07:05:08
阅读次数:
311
前几天打开一个老项目,然后真机运行了,但是提示没有对应的签名。然后xcode弹出一个提示 解决的提示框。就点了,然后就能解决。但是昨天准备上传到App Stroe的过程中,进行validate的时候,提示了下面图1的错误。 No identities were available 。然后各种折腾也不行,其实以前也遇到的,但是那时候没有记下解决的方法。
其实解决方法挺简单的:
第一次生成证书从第...
分类:
其他好文 时间:
2014-05-01 18:35:36
阅读次数:
400
题目:
Given a sorted (increasing order) array, write an algorithm to create a binary tree with minimal height.
翻译:
给定一个有序数组(递增),写程序构建一棵具有最小高度的二叉树。
思路:
要使二叉树的高度最小,则要尽量使其左右子树的节点数目相当,自然就考虑到将其构造成为二叉排序树,且将有序数组的中间大的数作为根节点,这样得到的二叉树的高度便是最小的。...
分类:
其他好文 时间:
2014-05-01 17:48:45
阅读次数:
321
qt有一套资源管理系统,如果将资源编译到可执行文件中,则可以直接访问可执行文件中的资源文件,
访问方式如下
:/prefix/location
但有的时候可以因为资源比较大,所以我们需要把资源编译成外部二进制资源文件*.rcc文件,这样可以提高可执行文件的加载速度。
编译方式rcc -binary myresource.qrc -o myresource.rcc
然后通过
QResou...
分类:
其他好文 时间:
2014-04-30 22:14:39
阅读次数:
487
原题链接: http://oj.leetcode.com/problems/unique-binary-search-trees/
这道题要求可行的二叉查找树的数量,其实二叉查找树可以任意取根,只要满足中序遍历有序的要求就可以。从处理子问题的角度来看,选取一个结点为根,就把结点切成左右子树,以这个结点为根的可行二叉树数量就是左右子树可行二叉树数量的乘积,所以总的数量是将以所有结点为根的可行结果...
分类:
其他好文 时间:
2014-04-30 22:12:39
阅读次数:
244