- 博客(175)
- 资源 (14)
- 收藏
- 关注
原创 优化内存的思想方式
// :唯一的标示BaseUI的子类 // 每增加一个界面150K-16M // 内存不足的时候 // 处理的方案: // 第一种方式:控制VIEWCAHCE集合的size // 第二种方式:使用Fragment代替,replace方法,不会缓存界面 // 第三种方式:将BaseUI引用级别降低 // 当前级别---强引用(GC宁可抛出OOM,也不会回收BaseUI) //
2015-02-09 14:01:46
308
原创 [vim]我的makefile
.SUFFIXES:.c .o //.c和.o建立关联 CC=g++ SRCS=hello.c\ add.c //同时编译两个.c文件 OBJS=$(SRCS:.c=.o) //OBJS=hello.o add.o EXEC=hello start:$(OBJS)
2015-02-03 09:45:31
289
原创 给ubuntu设置主题,使得eclipse提示好看
在Ambiance主题下,eclipse弹出的tip是黑色背景的,这样压根就看不清java doc。 当然可以在外观改变系统主题为其他主题,相应的gtk-2.0/gtkrc要重新设置,比如Ubuntu12.04默认主题为Ambiance,那我们可以把如下路径改为: /usr/share/themes/Ambiance/gtk-2.0 解决办法: cd /us
2015-01-22 13:28:25
488
原创 【leetcode】3Sum Closest
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact
2014-08-12 23:15:30
372
原创 【leetcode】
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: Elements in a triplet (a,b,c
2014-08-12 21:53:25
366
原创 【leetcode】Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
2014-08-05 22:10:21
384
原创 【leetcode】Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \ 3 4 4 3 But the f
2014-08-05 20:58:38
394
原创 【leetcode】Plus One
Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at the head of the list. class Solution { pub
2014-08-05 20:54:05
356
原创 【leetcode】Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word does not exist, return 0. Note: A word is
2014-08-04 22:16:59
373
原创 【leetcode】Remove Element
Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn't matter what you leave beyond the new length.
2014-08-04 21:43:40
386
原创 【leetcode】Median of Two Sorted Arrays※※※※※
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). 找两个已经排序的数组
2014-08-03 22:16:56
347
原创 【leetcode】Search in Rotated Sorted Array II
Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time complexity? How and why? Write a function to determine if a given target is in the
2014-08-03 21:19:46
344
原创 【leetcode】Search in Rotated Sorted Array
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target value to search. If found in the array retur
2014-08-03 20:10:19
362
原创 【leetcode】Remove Duplicates from Sorted Array II
Remove Duplicates from Sorted Array II Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Given sorted array A = [1,1,1,2,2,3], Your f
2014-08-03 19:37:42
347
原创 【android入门基础】黑马训练营的android培训——01
1、Android版本简介 2、Android体系结构 3、JVM和DVM的区别 4、常见adb命令操作 5、Android工程目录结构 6、点击事件的四种形式 7、电话拨号器Demo和短信发送器Demo
2014-08-01 19:52:50
321
原创 【leetcode】Best Time to Buy and Sell Stock II
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on
2014-07-31 21:57:12
298
原创 【leetcode】Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Here are some good questions to ask before c
2014-07-31 19:59:01
337
原创 【leetcode】Same Tree
Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
2014-07-30 21:54:02
370
原创 【leetcode】Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
2014-07-30 21:25:40
339
原创 【leetcode】single number
Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using ext
2014-07-30 21:21:34
366
原创 【java】java基础manager类
import java.util.*; public class ManagerTest { public static void main(String[] args) { Manager boss=new Manager("Carl Cracker", 8000, 1980, 10, 10); boss.setBonus(5000);
2014-06-16 11:29:19
2251
转载 【JAVA】java环境变量控制
1.下载JDK: http://java.sun.com/javase/downloads/index.jsp 2.安装JDK 3.配置JDK: (1)右击【我的电脑】->【属性】->【高级】->【环境变量】 (2) JDK安装路径:D:/Java/jdk1.5.0_04(根据个人情况,我自己装在D盘)
2014-06-15 15:48:10
414
原创 【c语言基础必备】c语言struct中int data[0]的使用——c语言中的变长数组
今天在看一段代码时出现了用结构体实现变长数组的写法,一开始因为忘记了这种技术,所以老觉得作者的源码有误,最后经过我深思之后,终于想起以前看过的用struct实现变长数组的技术。下面是我在网上找到的一篇讲解很清楚的文章。 在实际的编程中间,我们通常会要设计到变长数组,但是C语言不支持b struct MyData { int nLen; char data[0];}; 在结构中,dat
2014-05-19 21:08:59
1994
转载 【算法】skiplist——调表,一种随机化的类平衡二叉树
参考文章:http://dsqiu.iteye.com/blog/1705530 参考文章:http://www.cnblogs.com/xuqiang/archive/2011/05/22/2053516.html
2014-05-18 19:22:32
934
转载 【算法】非递归不用栈的二叉树遍历算法伪代码
树的遍历,尤其是二叉树的遍历算法是常见并且非常重要的,关于这个问题的讨论网上已经有很多,并且很多教材也做了分析,从递归实现,到非递归用栈来实现,以及非递 归不用栈来实现,最后一种被认为是繁琐的,特别具体实现时要考虑不少细节,下面是 我整理的比较容易写出来且容易记忆的一种写法,算是抛砖引玉吧。 目录 [隐藏] in-order(中序)pre-order(前序)post-order(后
2014-05-07 19:11:42
777
转载 【算法】如何用栈实现递归与非递归的转换
如何用栈实现递归与非递归的转换 一.为什么要学习递归与非递归的转换的实现方法? 1)并不是每一门语言都支持递归的. 2)有助于理解递归的本质. 3)有助于理解栈,树等数据结构. 二.递归与非递归转换的原理. 递归与非递归的转换基于以下的原理:所有的递归程序都可以用树结构表示出来.需要说明的是, 这个"原理"并没有经过严格的数学证明,只是我的一个猜想,不
2014-05-05 13:20:23
758
原创 【算法】完全散列——理解与代码
散列表的基本概念 假设某应用要用到一个动态集合,其中每个元素都有一个属于[0..p]的关键字,此处p是一个不太大的数,且没有两个元素具有相同的关键字,则可以用一个数组[p+1]存储该动态集合,并且使用关键字作为数组下标进行直接寻址。这一直接寻址思想在前面的非比较排序中就有所应用。然而,当p很大并且实际要存储的动态集合大小n 散列表(Hashtable),使用具有m个槽位的数组来存储大小为n的动
2014-05-03 21:42:34
1009
转载 【算法】基数排序——经典扑克排序,二维数组按列排序的出处
《桶排序 》中我们能够看到,数据值的范围越大,可能需要桶的个数也就越多,空间代价也就越高。对于上亿单位的关键字,桶排序是很不实用的。基数排序是对桶排序的一种改进,这种改进是让“桶排序”适合于更大的元素值集合的情况,而不是提高性能。 多关键字排序问题(类似于字典序): 我们先看看扑克牌的例子。一张牌有两个关键字组成:花色(桃 (1) 首先按照花色对所有
2014-04-28 19:11:22
826
转载 【算法】桶排序——二层数据结构的思想
从《基于比较的排序结构总结 》中我们知道:全依赖“比较”操作的排序算法时间复杂度的一个下界O(N*logN)。但确实存在更快的算法。这些算法并不是不用“比较”操作,也不是想办法将比较操作的次数减少到 logN。而是利用对待排数据的某些限定性假设 ,来避免绝大多数的“比较”操作。桶排序就是这样的原理。 桶排序的基本思想 假设有一组长度为N的待排关键字序列K[1..
2014-04-28 18:58:32
425
转载 【CSAPP】C函数调用机制及栈帧指针
在Linux内核程序boot/head.s执行完基本初始化操作之后,就会跳转去执行init/main.c程序。那么head.s程序是如何把执行控制转交给init/main.c程序的呢?即汇编程序是如何调用执行C语言程序的?这里我们首先描述一下C函数的调用机制、控制权传递方式,然后说明head.s程序跳转到C程序的方法。 函数调用操作包括从一块代码到另一块代码之间的双向数据传递和执行控制转移。
2014-04-20 14:32:30
595
转载 【卡尔曼】卡尔曼滤波学习笔记-Matlab模拟温度例子
KF是根据上一状态的估计值和当前状态的观测值推出当前状态的估计值的滤波方法 温度模拟参数选取 xk 系统状态 实际温度 A 系统矩阵 温度不变,为1 B、uk 状态的控制量 无控制量,为0 Zk 观测值 温度计读数 H 观测矩阵 直接读出,为1 wk 过程噪声 温度变化偏差,常
2014-04-17 15:48:00
890
arcgis engine 二次开发资料汇总
2013-11-19
Core Data by Tutorials swift 2 ios9
2015-12-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人