题目
Reverse a linked list from position m to n. Do it in-place and in one-pass.
For example:
Given 1->2->3->4->5->NULL, m = 2 and n =
4,
return 1->4->3->2->5->NULL.
Note:
Given m,...
分类:
其他好文 时间:
2014-06-11 06:07:11
阅读次数:
392
一、表
学生表
CREATE TABLE `t_student` (
`stuNum` int(11) NOT NULL auto_increment,
`stuName` varchar(20) default NULL,
`birthday` date default NULL,
PRIMARY KEY (`stuNum`)
) ENGINE=In...
分类:
数据库 时间:
2014-06-11 00:22:53
阅读次数:
249
/**
* Canvas清屏的操作
*
* 参考资料: http://blog.csdn.net/lfdfhl/article/details/9076001
*
*/
private void cleanCanvas() {
mCanvas = mSurfaceHolder.lockCanvas();
if (mCanvas != null) {
Pain...
分类:
其他好文 时间:
2014-06-10 14:04:46
阅读次数:
173
public static String sendPost(String url, String
param)throws Exception { PrintWriter out = null; BufferedReader in = null;
Stri...
分类:
其他好文 时间:
2014-06-10 09:30:00
阅读次数:
234
前一篇介绍了cost的计算方法,下面测试一下两表关联的查询:测试用例CREATE TABLE
`xpchild` ( `id` int(11) NOT NULL, `name` varchar(100) DEFAULT NULL, `c1`
int(11) DEFAULT NULL, `c2...
分类:
数据库 时间:
2014-06-10 08:55:13
阅读次数:
370
题目:输入两棵二叉树A和B,判断B是不是A的子结构分析:根据数的遍历方法,首先想到的是采用递归的方式要更简单些,树A从根节点进行遍历,首先判断与B的根节点值是否相等,如果相等则进行递归遍历验证,否则验证树A的其他节点,直到所有的结点遍历完。注意的就是指针是否为NULL,因为自己编程能力不好,所以有些...
分类:
其他好文 时间:
2014-06-10 08:27:18
阅读次数:
162
binary search\sort\find operations
status InsertNode(Node* root, data x, Node* father)
{
if(root==NULL)
{
if(father==NULL)
Tree empty;
else
{
if(xdata)
{
father->left=new Node//inital l...
分类:
其他好文 时间:
2014-06-10 08:09:49
阅读次数:
234
1.一个比较头疼的问题:
jackson + spring 支持rest接口,输出的JSON 对于null的字符串是invoiceTitle: null,但是接受方希望返回的是invoiceTitle:
""。解决方法重写ObjectMapper
2.代码如下:
public JsonMapper() {
//this(Include.NON_EMPTY);
// 空值...
分类:
其他好文 时间:
2014-06-10 07:28:26
阅读次数:
354
我手动配置hibernate4.3.4,测试的时候出现:
Caused by: org.hibernate.HibernateException: Connection cannot be null when 'hibernate.dialect' not set
我是按照官方文档配置的,但是官方文档的代码好像有点问题
这是官方文档里面的那个工具类的部分代码:return new Confi...
分类:
系统相关 时间:
2014-06-10 07:26:34
阅读次数:
371
问题:
给定一个有序链表,生成对应的平衡二叉搜索树。
分析
见Convert
Sorted Array to Binary Search Tree
实现:
TreeNode *buildTree(ListNode* head, ListNode *end){
if(head == NULL || head == end)
return NULL;
...
分类:
其他好文 时间:
2014-06-10 07:17:29
阅读次数:
264