1. ArrayList概述:
ArrayList是List接口的可变数组的实现。实现了所有可选列表操作,并允许包括 null 在内的所有元素。除了实现 List
接口外,此类还提供一些方法来操作内部用来存储列表的数组的大小。 每个ArrayList实例都有一个容量,该容量是指用来存储列表元素的数组...
分类:
其他好文 时间:
2014-05-23 12:07:19
阅读次数:
384
原文:http://grails.org/doc/2.3.x/ref/Domain%20Classes/list.htmllistPurposeLists
instances of the domain class.Examples// list everythingdef results = Bo...
分类:
数据库 时间:
2014-05-23 11:42:42
阅读次数:
661
题目链接题意:给出单链表头指针,要求交换链表中每一对相邻的结点.注意:不可以改变链表中结点的值,只可以使用常量空间.附上代码:
1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int
val;...
分类:
其他好文 时间:
2014-05-23 10:43:49
阅读次数:
249
Remove Duplicates from Sorted Array IIFollow up
for "Remove Duplicates":What if duplicates are allowed at mosttwice?For
example,Given sorted array A =...
分类:
其他好文 时间:
2014-05-23 10:23:40
阅读次数:
250
假设给我们一个泛型对象List,T为int类型,要求我们使用该对象方法FindAll(Predicate match)从中找出该List中的偶数,您如何实现?
说明一下:Predicate是一个泛型委托,它的原型为public delegate bool Predicate(T obj),该委托传....
分类:
其他好文 时间:
2014-05-23 10:04:08
阅读次数:
350
5道题目分别是:【Subsets】、【Subsets II】、【Unique Paths】、【Unique Paths II】、【Trapping Rain Water 】,由于有一些题目不需要发一整篇博文来记录,所以就将这些题目以一篇博文5道来记录。...
分类:
其他好文 时间:
2014-05-22 08:35:03
阅读次数:
348
戳我去解题Given an array where elements are sorted in
ascending order, convert it to a height balanced
BST.分析:因为BST中序序列是升序的,所以中序遍历序列最中间的元素一定是根节点,然后左右递归构建二叉...
分类:
其他好文 时间:
2014-05-20 11:38:16
阅读次数:
233
1
添加listctrl的头m_list.setextendedstyle(LVS_EX_FULLROWSELECT||LVS_EX_GRIdLINES);m_list.insertcolumn(0,"dasdasd",LVCFMT_CENTER,100);m_list.insertcolumn(1...
分类:
其他好文 时间:
2014-05-20 11:27:20
阅读次数:
254
戳我去解题Merge two sorted linked lists and return it as
a new list. The new list should be made by splicing together the nodes of the
first two lists.分析:直...
分类:
其他好文 时间:
2014-05-20 08:52:09
阅读次数:
277
戳我去解题Given a linked list, remove thenthnode from
the end of list and return its head.For example, Given linked list:
1->2->3->4->5, and n = 2. Aft...
分类:
其他好文 时间:
2014-05-20 08:04:28
阅读次数:
291