- 博客(8)
- 资源 (7)
- 收藏
- 关注
原创 Leetcode-516-Longest Palindromic Subsequence
Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000.题目的意思是找到字符串s中最长的回文子序列:Example 1:Input:"bbbab"Output:4
2017-02-22 15:22:18
269
原创 C++ 类的静态成员
static 静态成员是属于整个类的,不是某个对象。在所有对象中可以共享它。1. 可以通过类名直接调用静态成员,非静态成员则不行。如:class Student{public: static void init() { }};void main(){ Student::init();}2. 静态成员在类实例化对象之前就已经分配空间,因此不能调用非静态成员,因为
2017-02-22 10:02:53
261
原创 Leetcode-198-House Robber
题目:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacen
2017-02-21 16:16:38
231
原创 C语言定义全局变量
C语言定义全局变量时,在有多个.c/.h文件情况下发生了error LNK2005: "int abc"已经在 xxx.obj 中定义的错误原因是定义时在头文件中定义了int abc,没有定义extern int abc。后来定义了.h 中定义了extern int abc,但是在引用.h后没有在.c文件中写int abc,导致找不到abc。。。最终终于找到了方法,定义全局变量时要在一
2016-04-18 09:49:51
2252
原创 最大子序列和算法
题目:求A[i]中和最大的子序列。时间复杂度O(NlogN): 使用分治+递归的方法。分别求出左边N/2长度的最大子序列和、右边N/2长度的最打字序列和、以及横跨这两部分且通过中间的最大和(要分别求出两边带有最中间边界的最子大序列和,将其相加),由于不是最简单的方法,这里不再赘述。时间复杂度O(N):遍历一遍A即可得到结果:
2015-09-14 14:49:34
485
原创 android开发 圆角按钮+点击换色
开发需要圆角按钮,并且想要在点击时换色1. 在res/drawable中添加roundButton.xml <padding android:left="5dp" android:top="10dp" android:right="5dp" android:bottom="10dp" /> <padding android:left="
2015-06-05 16:31:10
503
原创 解决android studio ADB无响应的问题:If you'd like to retry,then please manually kill "adb.exe"
LZ在打开android studio之后经常无法打开adb,应该是某些程序占用了ADB的端口,通过看各种大神的解决方案,找到了方法,这里记录下来,防止脑子坏掉又忘了,这已经不是第一次忘了如何解决搞定过的问题了。。。。提示:ADB not responding. you can wait more,or kill "adb.exe" process manually and click '
2015-06-05 15:28:47
1168
转载 Activity的四种launchMode
文章转自Activity的四种launchMode,写的很好,忍不住转了 launchMode在多个Activity跳转的过程中扮演着重要的角色,它可以决定是否生成新的Activity实例,是否重用已存在的Activity实例,是否和其他Activity实例公用一个task里。这里简单介绍一下task的概念,task是一个具有栈结构的对象,一个task可以管理多个Activity,启动一个
2015-06-05 09:55:58
303
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人