--创建一个表,此表作为子表
create table fk_t as select *from user_objects;
delete from fk_t where object_id is null;
commit;
--创建一个表,此表作为父表
create table pk_t as select *from user_objects;
delete from p...
分类:
数据库 时间:
2014-05-15 11:17:07
阅读次数:
248
题意:判断一个链表中是否有环
思路:快慢指针,如果有环,最终快慢指针会在非NULL相遇
注:用到fast->next前先要确保fast非NULL,要用fast->next->next前先要确保fast,fast->next非NULL
复杂度:时间O(n), 空间O(1)
相关题目:Linked List CycleII...
分类:
其他好文 时间:
2014-05-15 07:01:57
阅读次数:
219
本文分别用非递归和递归两种方式实现了链表的反转,在九度OJ上测试了非递归版本,AC。
题目描述:
输入一个链表,反转链表后,输出链表的所有元素。
(hint : 请务必使用链表)
输入:
输入可能包含多个测试样例,输入以EOF结束。
对于每个测试案例,输入的第一行为一个整数n(0<=n<=1000):代表将要输入的链表的个数。
输入的第二行包含n个整数t(0<=t<=1000000):代表链表元素。
输出:
对应每个测试案例,
以此输出链表反转后的元素,如没有元素则输出NULL。
样例输入:...
分类:
其他好文 时间:
2014-05-15 06:41:12
阅读次数:
315
题意:给定一棵任意二叉树(不一定是perfect binary tree),将它每一个节点的next指针都指向该节点右边的节点
思路:bfs
这里不能用dfs了,只能用bfs
bfs遍历将同一层的节点存放在同一个数组里,
然后在遍历每个数组,将前面的节点和后面的节点connect起来,
最后一个节点和NULL connect起来
需要定义一个新的struct结构,保存指向每个节点的指针和该节点所在的层
复杂度:时间O(n), 空间O( n)...
分类:
其他好文 时间:
2014-05-15 06:12:13
阅读次数:
294
BUILD FAILEDG:\android\SDK\android-sdk-windows\tools\ant\build.xml:645: The following erroroccurred while executing this line:G:\android\SDK\android-sdk-windows\tools\ant\build.xml:683: null returned:...
分类:
移动开发 时间:
2014-05-15 04:48:27
阅读次数:
647
自定义对话框设置style
@null
true
true
false
@null
true
@null
@null
true
false
true
@null
...
分类:
移动开发 时间:
2014-05-15 04:27:51
阅读次数:
352
(null): File is universal (3 slices) but does not contain a(n) armv7s slice: /Users/robin/Documents/Project/ZBarApp/ZBarApp/ZBarSDK/libzbar.a file '/Users/robin/Documents/Project/ZBarApp/ZBarApp/ZBarS...
分类:
其他好文 时间:
2014-05-15 03:13:59
阅读次数:
397
1UIAlertView类似于Android中的Dialog,简单用法如下:UIAlertView*alertView=[[UIAlertViewalloc]initWithTitle:@"Title"message:@"Messate"delegate:nilcancelButtonTitle:@"Cancle"otherButtonTitles:nil,nil];[alertViewshow];2UIActionSheet底部弹出的对话框,较常用,简..
分类:
移动开发 时间:
2014-05-14 16:24:55
阅读次数:
332
staticint_osip_message_parse(osip_message_t*sip,constchar*buf,size_tlength,intsipfrag){inti;constchar*next_header_index;char*tmp;char*beg;tmp=osip_malloc(length+2);if(tmp==NULL){OSIP_TRACE(osip_trace(__FILE__,__LINE__,OSIP_ERROR,NULL,"Couldnotallocatememory..
分类:
其他好文 时间:
2014-05-14 16:06:25
阅读次数:
296
红黑树是一个二叉搜索树,具有如下规则:
每个节点不是红色就是黑色。根节点必须为黑色。如果节点为红,其子节点必须为黑,父子节点不得同时为红。任一节点至NULL(NULL为黑色)的任何路径,所含黑节点数必须相同。
根据规则4,新增节点必须为红。
根据规则3,新增节点的父节点必须为黑。
因为新增节点必须是红,那么只有在父节点不为黑的时候才需要调整,父节点为黑则无需调整。
着...
分类:
其他好文 时间:
2014-05-14 15:29:28
阅读次数:
287