码迷,mamicode.com
首页 >  
搜索关键字:nullptr null 0    ( 34233个结果
编程Tips
三元运算符Vb中的iif(expr,truepart,falsepart)和C#中的expr?truepart:falsepart.无论expr的结果是true还是false,true/falsepart都会被执行.所以不能写类似于obj!=null?obj.name:string.empty.tr...
分类:其他好文   时间:2014-06-10 21:38:50    阅读次数:212
java:I/O 根据用户输入反馈信息
import java.io.*;class userInputIO{ //Java中成员变量有默认初始化,也就是如果不显式设置初始值的话就会被初始化为其类型的默认值(0、false、null等)。 private BufferedReader buffered...
分类:编程语言   时间:2014-06-10 20:15:03    阅读次数:250
数据库2014年6月10日11:13:10
SQL语句创建数据库:create table student(id int not null primary key,number nvarchar not null,name nvarchar not null,brithday DateTime default getdate(), adres...
分类:数据库   时间:2014-06-10 19:48:24    阅读次数:284
MFC获取系统当前时间
1.使用CTime类 CString str; //获取系统时间 CTime tm; tm=CTime::GetCurrentTime(); str=tm.Format("现在时间是%Y年%m月%d日 %X %H:%M:%S");MessageBox(str,NULL,MB_OK);%a...
分类:其他好文   时间:2014-06-10 19:46:24    阅读次数:337
【leetcode】sort list
问题:对链表进行排序,要求时间复杂度为NlogN。归并排序。 inline ListNode* getMidle(ListNode *head){ if(NULL == head || NULL == head->next) return head; ListNode *pslow = head; ListNode *pfast = head; while (pfast->next...
分类:其他好文   时间:2014-06-10 17:35:56    阅读次数:282
【leetcode】reverse Nodes in k-groups
问题: 给定一个链表的头指针,以及一个整数k,要求将链表按每k个为一组,组内进行链表逆置。少于k个的部分不做处理。 分析: 个人觉得问题的重点是熟悉链表的就地逆置操作,就是头插法。其他的考察点如果还有的话,就的细心程度。 实现: void reverseList(ListNode *&pre, ListNode *head) { ListNode *tail = NULL; w...
分类:其他好文   时间:2014-06-10 17:25:45    阅读次数:305
SQL自增长的数据插入
--子增长的插入 /*创建表*/ create table teacher ( id int identity(1,1) primary key not null, name varchar(20) ) select * from teacher/*关闭自增长*/SET IDE...
分类:数据库   时间:2014-06-10 12:21:35    阅读次数:243
手写BST插入查找删除
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
[FAQ]jackson解决:null到"", 空值处理为空串
1.一个比较头疼的问题: jackson + spring 支持rest接口,输出的JSON 对于null的字符串是invoiceTitle: null,但是接受方希望返回的是invoiceTitle: ""。解决方法重写ObjectMapper 2.代码如下: public JsonMapper() { //this(Include.NON_EMPTY); // 空值...
分类:其他好文   时间:2014-06-10 07:28:26    阅读次数:354
【leetcode】Convert Sorted List to Binary Search Tree
问题: 给定一个有序链表,生成对应的平衡二叉搜索树。 分析 见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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!