自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(33)
  • 收藏
  • 关注

原创 Android ClickableRoundedBackground Span实现(初版)

一、自定义圆角背景spanpackage com.taobao.search.searchtip;import android.graphics.Canvas;import android.graphics.Paint;import android.graphics.RectF;import android.taobao.util.TaoLog;import android.text.sty

2015-12-01 19:57:35 1485 1

原创 GridView Adapter里的getView为啥会多次调用position 0

GridView Adapter里的getView为啥会多次调用position 0一、问题描述GridView Adapter里的getView方法总会调用很多次的position 0 图中的GridView 包含9个大小相同的itemView,区别在于itemView中包含的textView中的文字不同。二、问题分析getView方法既然是getView引起的,我们就先从这个方法本身入手,

2015-10-09 21:17:18 5896 3

原创 ArrayList遍历方式比较实验

遍历方式增强型for循环 也称为for-each循环,是jdk 1.5中新增的循环模式,我们在程序中会越来越倾向于使用这种方式遍历集合,因为它使用起来更方便。 而在郭大侠的文章:Android最佳性能实践(三)中提到对于ArrayList这种集合,“自己的手写for循环比for-each快”,针对这一结论,我们做一个小实验来验证下结论的可靠性:实验过程采用3种遍历ArrayList的

2015-10-08 20:34:25 701

原创 反思-工作总结(20150706-0921)

工作快3个月了,这三个月以来的关键词就是:反思。三个月的工作,会有压力,会有小小的成就感,会在不断寻求突破,会一直给自己打气。但是与此同时,会意识到自己身上存在很多问题,列举如下:1.硬实力方面:处理问题或者需求时,不善于考虑到更多的方面,没有深入思考很多相关的东西,换句话说:就是没有把东西做到极致;做需求时,一些技术的使用,相关业务的牵连,并没有思考得十分透彻,而是停留在

2015-09-21 23:12:55 694 2

原创 Android LaunchMode的详解

来自Android LaunchMode的温馨提示

2015-08-15 18:24:24 2278

原创 随笔20150223

连日的感冒像个矫情的小情人,紧紧抓住你的衣角不肯离去。近日以来与老妈的一次争执,让我看到个性中的注定柔软,但也难免积压爆发,人应该就是这样的吧,会被一些特定的语气与言语触及底线,也越是因为亲人,越敢于自我暴露,所以下一次对自己最亲的人,性子还是要收一收的。昨日的悲伤欲裂,今日一觉醒来,想想也不过是昨天,我们要留给长大一些时间,而很多事情也不过是再加个期限。在写这样的轻博客之前,

2015-02-23 13:47:48 443

原创 C++ 求一个字符串的所有排列

代码如下:

2014-09-22 01:19:52 1689

原创 C++ 二叉树中和为某一值的路径

思路:递归、判断技术条件、采用vector代码:

2014-09-20 01:19:43 749

原创 C++ 从上到下,从左至右打印二叉树

代码如下:#include #include "BinaryTree.h"#include using namespace std;void PrintTree_from_head_to_tail(TreeNode* proot){ if(proot == NULL) return; deque tree_que; TreeNode* node = proot; tre

2014-09-19 15:51:18 1224

原创 C++ 判断栈的弹出序列是否正确

题目:给出一个栈的压入序列,判断给出的弹出序列是否正确。daima

2014-09-19 15:11:12 928

原创 C++ 判断是否为2叉树的子树

题目:输入A.B 两棵树,判断

2014-09-16 15:16:16 615

原创 C++ 合并链表

合并2个递增链表,使得合并后仍保持递增顺序:MergeList.cpp:

2014-09-16 11:04:54 869

原创 C++ 调整数组使得奇数位于偶数后面

代码如下:/*调整数组的顺序使得数组中偶数在奇数前面*/#include #include using namespace std;class Solution{public: void swap(int &a ,int &b) { int temp = b; b = a; a = temp; } int * reorder(int array[],int le

2014-09-15 13:53:29 1330

原创 C++ 求斐波那契数列 递归法 迭代法

代码:/*递归法、迭代法求斐波那契数列*/#include #include using namespace std;class Solution{public: int Fib(int n) { if(n == 0) return 0; if(n == 1) return 1; if(n > 1) return Fib(n-1) + Fib(n-

2014-09-14 11:23:20 7944

原创 C++ 求旋转字符串中的最小值

思路比较简单,直接看代码即可:/*求一个旋转字符串中最小值*//*思路:遇到没有旋转以及数组中相同位置元素相等的采用顺序查找*/#include #include #include using namespace std;class Solution{public: int find(int array[],int length) { int i=0, min = ar

2014-09-14 10:52:10 602

原创 C++ 二分查找的递归与非递归实现

非常简单的东西,直接看看代码。/*二分查找的递归与非递归实现*/#include using namespace std;//设定为非重复的递增整数列:循环方法int BinarySearch(int array[],int value,int length){ if(array == NULL || length < 1) return -1; int lp = 0; i

2014-09-12 22:25:52 455

原创 LeetCode:Construct Binary Tree from Preorder and Inorder Traversal

题目:Given preorder and inorder traversal of a tree, construct the binary tree.代码如下:

2014-09-12 20:06:12 770

原创 LeetCode: Combinations 递归回溯 2种实现方法

题目:Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3], [1,2], [1,3],

2014-09-12 13:50:04 487

原创 C++ 单例模式 拷贝构造函数 手动实现

单例模式 涉及到 智能指针,内存中的堆和栈代码如下:

2014-09-11 21:27:21 2382

原创 C++ 静态成员函数小练习

首先,我们可以先看1个小例子:

2014-09-10 13:25:56 572

原创 Leetcode:subsets2 duplicate number

题目如下:Given a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not co

2014-09-09 17:39:24 446

原创 Leetcode: Subsets

题目:Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.

2014-09-09 16:56:52 455

原创 Leetcode Anagrams

题目:Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.代码如下:

2014-09-09 11:39:51 323

原创 Leetcode:Remove Duplicates from Sorted List

题目:Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, return 1->2->3.代码如下:

2014-09-02 18:51:29 399

原创 O(1)时间求一个栈的最小值

/*O(1)求出一个栈的最小值*/#include #include #include #define maxsize 10using namespace std;int main(){ stack source; stack compare; for(int i = 0;i < maxsize;i++) { int input; cin >> input;

2014-09-02 17:57:02 467

原创 LeetCode: Linked List Cycle II

题目:Linked List Cycle II :Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra space?代码:

2014-08-27 19:45:55 334

原创 C++: 7种排序 算法原理展示

先贴上代码:(其中duipaipaixv)

2014-08-19 19:15:13 405

原创 PAT 1001 1002

PAT题目1001:解题思路:这道题,虽然看起来很简单,但是还是有很多细节要注意的。因为在运算各个位的时候,低位先得到,高位后得到,而要保证输出的顺序正确,所以采用了栈的结构。代码如下:#include #include #include #include using namespace std;int main(){ int

2014-08-15 19:09:23 420

原创 PAT 1065

PAT1065题目如下:

2014-08-15 19:06:23 409

原创 求一个长度为n的整型有序数组中是否有出现次数超过n/2的元素

面试题:            一个长度为n的整型有序数组,求这个

2014-08-12 20:49:29 3622

原创 内存那点儿事儿(一)

一、Linux分配给进程中的地址空间:l  代码段存储程序文本,又称文本段,指令指针从这里获得指令,可以被共享。l  数据段用来存储数据。分为初始化为非0的数据区,BBS(Block Started by Symbol 用来存放未初始化的全局数据和静态数据)和堆(Heap 用来动态分配内存,就是说malloc等函数可以在这里或的分配内存,地址是向上增长的)l  堆栈段(St

2014-08-07 15:45:16 477

原创 C++小实验之多态性理解

#include #include using namespace std;class Cup{public:virtual void color() = 0;};class TeaCup{public:virtual void color(){cout << "have a tea,change a mood " << endl;}};class Fathor{public:virtual vo

2014-08-01 15:11:22 482

原创 BUG解析之0xC0000005: 读取位置 0x00000000 时发生访问冲突。

错误内容如下:

2014-07-30 12:11:04 7234 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除