这是一个及其常见的问题,网上已经有关于这个问题的很多讨论。但是我觉得都是不求甚解,有一些还是在误导别人。下面我来说下我对这三者的理解,如有错误的地方请大家及时指正。 一:""与string.Empty我认为是一样的。网上有一篇被转载了几十遍的文章是这样说的string.Empty 不分配存储空间,....
分类:
其他好文 时间:
2015-05-21 12:39:04
阅读次数:
93
解决方案一:Button btn=new Button(new ContextThemeWrapper(mContext,R.style.service_text_dialog_style),null,R.style.service_text_dialog_style);解决方案二(待验证):Tex...
分类:
移动开发 时间:
2015-05-21 12:21:13
阅读次数:
1925
Reverse a singly linked list.思路:没啥好说的。秒...ListNode* reverseList(ListNode* head) { ListNode * rList = NULL, * tmp = NULL; while(head != N...
分类:
其他好文 时间:
2015-05-21 12:19:41
阅读次数:
145
public class Solution { public boolean exist(char[][] board, String word) { if (board == null || board.length == 0) { return false...
分类:
其他好文 时间:
2015-05-21 12:15:15
阅读次数:
213
Collection框架的结构:
一、Collection结构框架图:
二、Set、List、Queue、Map
Set:collection的派生接口,不允许重复元素——equal(),取出元素的方法只有迭代器。
HashSet:按Hash算法查找、存取性能好;顺序不定;非同步,线程不安全;元素可为null。(hash意义在于快速查找,根据元素的值便可...
分类:
其他好文 时间:
2015-05-21 10:50:17
阅读次数:
113
BinaryTreePreorderTraversalTotalAccepted:67121TotalSubmissions:185051MySubmissionsQuestionSolutionGivenabinarytree,returnthepreordertraversalofitsnodes‘values.Forexample:Givenbinarytree{1,#,2,3},1
2
/
3return[1,2,3].分析:先序遍历树中的节点,采用递归的方..
分类:
其他好文 时间:
2015-05-21 06:49:26
阅读次数:
180
题目:请实现函数ComplexListNode *Clone(ComplexListNode *pHead),复制一个复杂链表。在复杂链表中,每个结点除了有一个m_pNext指针指向下一个结点外,还有一个m_pSibling指向链表中的任意结点或者NULL。结点的C++小定义如下:
struct ComplexListNode{
int m_nValue;
ComplexListNode *...
分类:
其他好文 时间:
2015-05-21 00:05:45
阅读次数:
209
反转链表,用了一个比较笨的方法。public class Solution { public ListNode reverseList(ListNode head) { if(head == null || head.next == null) retur...
分类:
其他好文 时间:
2015-05-21 00:00:01
阅读次数:
285
解题思路:中序遍历,左子树-根节点-右子树JAVA实现如下: public List inorderTraversal(TreeNode root) { List list = new ArrayList(); if(root==null) r...
分类:
编程语言 时间:
2015-05-20 23:56:04
阅读次数:
174
1 指令码 助记符 说明 2 0x00 nop 什么都不做 3 0x01 aconst_null 将null推送至栈顶 4 0x02 iconst_m1 将int型-1推送至栈顶 5 0x03 iconst_0 将int型0推送至栈顶 6 0x04 iconst...
分类:
其他好文 时间:
2015-05-20 23:49:56
阅读次数:
260