/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class...
分类:
其他好文 时间:
2015-07-03 10:37:38
阅读次数:
149
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class...
分类:
其他好文 时间:
2015-07-02 19:31:46
阅读次数:
97
废话不多说,直接上代码,哈哈,痛快:/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL)...
分类:
其他好文 时间:
2015-07-02 14:10:48
阅读次数:
91
function upd(obj){
var id = obj;
var page = $("input[name='page']").val();
//判断所选分类是否合法
$.post("/shop/sell/user/card/privilege/udpcheckclassify.jhtml", {
id : id...
分类:
Web程序 时间:
2015-07-02 12:17:09
阅读次数:
141
当一个数组有序时,要向其中插入元素,可以先使用二分搜索查找其要插入的位置,位置确定后可以执行插入操作。
其中二分搜索的循环体如下(部分代码,具体见文章最后): while(low<=high){//循环条件
mid = (low+high)/2; if(a[mid]<val){
low = mid+1;
}else if(...
分类:
编程语言 时间:
2015-07-02 10:08:37
阅读次数:
131
步进电机思想的应用:可以一次走一步,也可以一次走多步(一次跨过多个具有相同属性的事物)。代码如下:/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
*...
分类:
其他好文 时间:
2015-07-02 10:06:01
阅读次数:
179
文件正则表达式&练习1. 编写一小段Scala代码,将某个文件中的行倒转顺序,将最后一行作为第一行,依此类推 程序代码:import scala.io.Source import java.io.PrintWriter object ReverseLines extends App { val fi...
分类:
其他好文 时间:
2015-07-02 09:47:26
阅读次数:
232
typedef union _zvalue_value {
longlval; /* long value */doubledval; /* double value */struct {
char *val;
intlen;
} str;
HashTable *ht; ...
分类:
Web程序 时间:
2015-07-01 18:12:18
阅读次数:
138
代码: 1 #include 2 #include 3 4 using namespace std; 5 6 struct ListNode { 7 int val; 8 ListNode *next; 9 ListNode(int x) : val(x), ne...
分类:
其他好文 时间:
2015-07-01 18:00:08
阅读次数:
84
Given a string containing just the characters
'(', ')', '{', '}', '[' and
']', determine if the input string is valid.
The brackets must close in the correct order,
"()" and "()[]{}" are all val...
分类:
其他好文 时间:
2015-06-30 23:40:25
阅读次数:
285