题目描述:(链接)Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.解题思路: 1 /** 2 * Definition for ....
分类:
其他好文 时间:
2015-12-17 22:27:19
阅读次数:
228
题目描述:(链接)Given an array where elements are sorted in ascending order, convert it to a height balanced BST.解题思路: 1 /** 2 * Definition for a binary tre....
分类:
其他好文 时间:
2015-12-17 20:42:02
阅读次数:
122
//: Playground - noun: a place where people can playimport UIKit// swift中默认情况下, 传入的参数是不可以修改的, 也就是let类型, 也就是常量参数// 如果想修改这个参数的值, 需要在参数前加"var", 也就是变量参数fu...
分类:
编程语言 时间:
2015-12-17 16:01:53
阅读次数:
155
//: Playground - noun: a place where people can playimport UIKitfunc add(a:Int, b:Int) -> Int{ return a + b}// 其中, (Int, Int) -> Int 就是显式的声明函数类型let...
分类:
编程语言 时间:
2015-12-17 15:58:38
阅读次数:
154
//: Playground - noun: a place where people can playimport UIKit// 外部参数的作用是为了让程序员调用代码的时候能清晰的看出所传参数代表的意思// 内部参数指的就是定义函数的时候所设定需要传入的参数func sayHello(nickN...
分类:
编程语言 时间:
2015-12-17 12:56:44
阅读次数:
169
//: Playground - noun: a place where people can playimport UIKit// 定义一个数组var userScores:[Int]? = [12, 990, 572, 3258, 9999, 1024, 666]userScores = use...
分类:
编程语言 时间:
2015-12-17 12:27:38
阅读次数:
204
1. DELETE FROM sys_fun WHERE pids LIKE CONCAT('%',',',${value},',','%')2.从一张表中找到多条记录插入到另一张表中3.从另一张表中找到需要的字段赋值给当前表对应字段4.5. INSERT INTO inter_fu...
分类:
其他好文 时间:
2015-12-17 12:23:16
阅读次数:
139
//: Playground - noun: a place where people can playimport UIKit// 无参无返回// -> Void可以省略不写, 或者写成(), 因为返回值为空本质是一个空的元组func run() -> Void // (){ print("...
分类:
编程语言 时间:
2015-12-17 10:28:46
阅读次数:
172
把包含对象数据的DataRow转换成实体对象(泛型反射方式) public static T Row2Model(DataRow dr) where T : new() { T model = new T(); foreach (PropertyInfo p in (typeof...
分类:
其他好文 时间:
2015-12-17 00:36:50
阅读次数:
180
1) select * from T1 where exists(select * from T2 where T1.a=T2.a) ; T1数据量小而T2数据量非常大时,T1>T2 时,2) 的查询效率高。in 是把外表和内表作hash 连接,而exists是对外表作loop循环,每次loop循环...
分类:
数据库 时间:
2015-12-17 00:20:22
阅读次数:
215