题目
Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
方法
题目中是找出所有的字符串由相同的字符组成,只是顺序不同。
public List anagrams(St...
分类:
其他好文 时间:
2014-06-19 10:46:45
阅读次数:
207
一、由编译器生成的成员函数
1)默认的构造函数
默认构造函数定义为没有参数,或者有默认的参数值。当用户自己未定义时,系统可以提供。
自动生成的默认构造函数,会调用继承的基类的默认构造函数来构造派生类的基类部分。
若Star是一个类,则
Star orig;
Star array[6];都将需要默认构造函数。
如果自己定义了构造函数,则系统不会再生成默认构造函数,这个时候最好自己要定义...
分类:
编程语言 时间:
2014-06-16 12:23:39
阅读次数:
262
下标
swift允许我们为 类,结构体,枚举 定义下标,以更便捷的方式访问一大堆属性。比如Array和Dictionary都是结构体,swift的工程师已经为这两个类型提供好了下标操作的代码,所以,我们才可以通过 myArray[2]这种方式,读取和改写这个struct中保存的数据。而且,一个类型中可以定义多种下标访问方式(重载,关于重载,在后面的笔记中会提到,这里先不用太在意)
下标...
分类:
其他好文 时间:
2014-06-16 11:35:16
阅读次数:
173
题目
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
方法
矩阵坐标的转换,循环替换。
public voi...
分类:
其他好文 时间:
2014-06-16 11:28:03
阅读次数:
199
原题地址:https://oj.leetcode.com/problems/search-in-rotated-sorted-array-ii/题意:Follow
up for "Search in Rotated Sorted Array":What ifduplicatesare allowed...
分类:
编程语言 时间:
2014-06-16 08:20:54
阅读次数:
307
Given an array where elements are sorted in
ascending order, convert it to a height balanced BST.递归,二分法。 1 /** 2 *
Definition for binary tree 3 * st.....
分类:
其他好文 时间:
2014-06-16 00:33:31
阅读次数:
252
Given an unsorted integer array, find the first
missing positive integer.For example, Given [1,2,0] return 3, and [3,4,-1,1]
return 2.Your algorithm s...
分类:
其他好文 时间:
2014-06-13 20:25:38
阅读次数:
241
首先需要一个ttf文件的字体。在ios中的方法:把ttf文件放入资源文件下,然后在你的工程的Info.plist文件中新建一行(Add
Row),添加key为:Fonts provided by
application,类型为Array或Dictionary都行;添加Value为XXX.ttf(你字...
分类:
其他好文 时间:
2014-06-13 19:56:52
阅读次数:
428
配置内容同一样,只是增加一些配置。因为cas已经默认就支持MD5加密验证,所以只是修改一下配置就可以了。 增加一条内容 另外再在下面增加一条属性 完整的内容是:
分类:
其他好文 时间:
2014-06-13 19:05:35
阅读次数:
256
Say you have an array for which theithelement
is the price of a given stock on dayi.If you were only permitted to complete at
most one transaction (ie...
分类:
其他好文 时间:
2014-06-13 15:55:47
阅读次数:
273