JS诞生其中一个目的就是将, 服务器端的校验在客户端提前完成, 以避免用户提交数据后,
后台校验报错的糟糕用户体验。基于JQuery库的有很多优秀的插件, 其中对于浏览器端表单进行验证的基本功能也有插件对应, validate插件便是一个。官网地址
: http://jqueryvalidation...
分类:
Web程序 时间:
2014-07-22 23:13:35
阅读次数:
532
/** * Definition for binary tree * struct
TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) :
val(x), left(...
分类:
其他好文 时间:
2014-07-22 23:07:34
阅读次数:
312
Given a binary tree, find its maximum depth.The
maximum depth is the number of nodes along the longest path from the root node
down to the farthest le...
分类:
其他好文 时间:
2014-07-22 23:07:13
阅读次数:
379
Definition: see
wikihttp://en.wikipedia.org/wiki/Binary_search_tree 1 /* 2 This look up is a
fast operation because you eliminate the half 3 t...
分类:
其他好文 时间:
2014-07-22 23:06:34
阅读次数:
330
Given two binary trees, write a function to
check if they are equal or not.Two binary trees are considered equal if they are
structurally identical an...
分类:
其他好文 时间:
2014-05-01 16:06:46
阅读次数:
427
var isValid = $("#divId").Form("validate"); if(
isValid ){ alert("验证通过"); } else{ alert("验证失败"); }
分类:
其他好文 时间:
2014-05-01 15:09:20
阅读次数:
337
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-01 14:38:39
阅读次数:
454
这道题需要注意的地方有以下一些:1.
求从子树中的某节点到当前节点的最大路径不能采用递归方法,因为这个部分会被反复的调用,如果用递归,会使得之前已经计算过的节点被重复计算,使得时间复杂度特别高;2.
树中有节点的值是负数的。下面是AC代码。(我发现AC并不代表代码真的完全正确!!) 1 /** 2 ...
分类:
其他好文 时间:
2014-05-01 12:10:52
阅读次数:
274
泛型的Binary Search Tree的实现,并与STL map进行操作性能上的比较...
分类:
其他好文 时间:
2014-04-29 13:27:22
阅读次数:
420
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
思路同十进制的大数相加。代码如下:
class Solution {
public:
string addBinary(string a, str...
分类:
其他好文 时间:
2014-04-29 13:12:20
阅读次数:
328