Reverse Linked List IIReverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return...
分类:
其他好文 时间:
2015-01-14 10:59:29
阅读次数:
224
题目:将字符串翻转,比如输入"lavor_zl",输出“lz_roval”。
解题思路:
类似于顺序表的逆置,假设字符串长度为n,那么交换第1个与第n个字符,然后交换第2个和第n-1个字符,类似的交换其他的字符,一共交换n/2次
算法实现:
void reverseStr(char str[])
{
if(str==NULL) return;
int n=0;//用n...
分类:
其他好文 时间:
2015-01-14 09:48:08
阅读次数:
125
在Javascript中,我们经常会接触到题目中提到的这5个比较特别的对象——false、0、空字符串、null和undefined。这几个对象很容易用错,因此在使用时必须得小心。类型检测我们下来看看他们的类型分别是什么: 运行上述代码,弹出的对话框应该显示的都是true。也就是说,false是布....
分类:
编程语言 时间:
2015-01-14 09:43:47
阅读次数:
160
确认ImageView的图片是否加载成功本文地址:http://blog.csdn.net/caroline_wendy判断ImageView图片是否存在,未加载成功,就显示默认图片。 if (mPhotoView.getDrawable() == null) {
// Toast.makeText(getActivity(), "图片加载失败", Toast.L...
分类:
移动开发 时间:
2015-01-14 08:31:14
阅读次数:
209
1.内容观察者ContentObserver如果ContentProvider的访问者需要知道ContentProvider中的数据发生了变化,可以在ContentProvider 发生数据变化时调用getContentResolver().notifyChange(uri, null)来通知注册在...
分类:
移动开发 时间:
2015-01-14 00:42:24
阅读次数:
327
CREATE TABLE `ecm_address` (
`addr_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL DEFAULT '0',
`consignee` varchar(60) NOT NULL DEFAULT '',
`region_id` int(10) u...
分类:
数据库 时间:
2015-01-13 23:18:10
阅读次数:
526
ID3D11DeviceContext::PSSetShaderResources: Resource being set to PS shader resource slot 0 is still bound on output! Forcing to NULL. [ STATE_SETTING ...
分类:
其他好文 时间:
2015-01-13 23:12:06
阅读次数:
230
Extension Method: Return another string if string is null or emptyJust a tiny little extension method. You may know the ?? operator for null checks:va...
分类:
其他好文 时间:
2015-01-13 23:00:25
阅读次数:
211
#include "iostream"
#include "cstdio"
using namespace std;
struct Node{
int val;
Node *left, *right;
Node(int v = 0){
val = v;
left = NULL;
right = NULL;
}
};
inline void preOrder(Node *he...
分类:
其他好文 时间:
2015-01-13 21:44:22
阅读次数:
184