I use the Elicpse IDE to develope the ansdroid app.Sometime encounter the messy code in the Elicpse
One solve method is that to fix the Ecicpse's enCoding setting:
click "Windows->Preference...
分类:
其他好文 时间:
2014-06-19 09:57:22
阅读次数:
211
class Solution {public: vector grayCode(int n)
{ vector res; res.push_back(0); long pow2 = 1; for (int i=1; i <= n; i++...
分类:
其他好文 时间:
2014-06-16 07:11:52
阅读次数:
213
class Solution {private: const static char*
pattern[]; const static char* roman_digit[];public: string intToRoman(int num) {
if (num ...
分类:
其他好文 时间:
2014-06-16 07:04:22
阅读次数:
171
题目描述:输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字class Solution {public: vector spiralOrder(vector > &matrix) { vector result; int nRows = matrix.s...
分类:
其他好文 时间:
2014-06-14 21:27:53
阅读次数:
156
给的一个数列中,可能存在重复的数,比如 1 1 2
,求其全排列。记录上一个得出来的排列,看这个排列和上一个是否相同。#include #include #include using namespace std;
class Solution{public: vector > permuteU...
分类:
其他好文 时间:
2014-06-13 17:53:39
阅读次数:
280
class Solution {private: int getDirection(int
A[], int idx, int target, bool isDefaultBack) { int r = A[idx] - target; if (r
== 0) { ...
分类:
其他好文 时间:
2014-06-13 17:37:20
阅读次数:
221
求一个排列的下一个排列。1,2,3→1,3,23,2,1→1,2,31,1,5→1,5,1#include
#include #include using namespace std; class Solution{public: void
nextPermutation(vector &nu...
分类:
其他好文 时间:
2014-06-13 16:41:56
阅读次数:
173
apt-get install package 安装包 apt-get reinstall
package 重新安装包 apt-get upgrade 更新已安装的包 #apt-get update //更新软件列表 #apt-get check
//检查依赖性 apt-...
分类:
其他好文 时间:
2014-06-12 21:20:06
阅读次数:
283
Question:Sort a linked list inO(nlogn) time
using constant space complexity.Solution:Merge sort.找到链表的中间的那个ListNode. 1 /** 2
* Definition for singly-l....
分类:
其他好文 时间:
2014-06-12 17:59:34
阅读次数:
285