function quick_sort(list, head, tail) if tail > head then i = head j = tail tmp = list[i] --取第一个元素用于比较 同时腾出第一个位置 while i i do if list[j] tmp then li.....
分类:
其他好文 时间:
2014-08-11 20:59:12
阅读次数:
274
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'fromPyQt4.QtGuiimport*fromPyQt4.Qtimport*fromPyQt4importQtGui,QtCorefromPyQt4.QtCoreimport*imp...
分类:
其他好文 时间:
2014-08-11 20:56:52
阅读次数:
420
最近学QT,对信号槽机制感到有点新鲜:QObject::connect(slider, SIGNAL(valueChanged(int)), lcd, SLOT(display(int)));自己总结其原理,就是一句话:把两个对象的函数相关(往往是设置同一个值),而不用考虑两个对象之间的关系。缺点是...
分类:
其他好文 时间:
2014-08-11 20:46:52
阅读次数:
1061
作者 : 韩曙亮转载请著名出处 : http://blog.csdn.net/shulianghan/article/details/38297083一. 相关方法简介1. 状态保存方法示例package com.example.octopus_saveinstance;
import android.app.Activity;
import android.os.Bundle;
public...
分类:
移动开发 时间:
2014-08-11 18:04:52
阅读次数:
256
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-08-11 18:01:22
阅读次数:
243
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have
the following unique permutations:
[1,1,2], [1,2,1],
and [2,1...
分类:
其他好文 时间:
2014-08-11 17:49:32
阅读次数:
201
"""容器 Containers,有时候也被称为集合 collections,指的是能够在内存中存储其他特定类型的对象的对象,这种对象一般是通用的模板类。谓平台无关,即Qt容器类不因编译器的不同而具有不同的实现;所谓“隐式数据共享”,也可以称作“写时复制copy on write”,这种技术允许在容...
分类:
其他好文 时间:
2014-08-11 17:31:22
阅读次数:
1414
Apache服务器状态监控模块开启默认是禁止外网访问,如果更改了权限,可能导致信息泄露ExtendedStatusOn<Location/server-status>SetHandlerserver-statusOrderdeny,allow#DenyfromallAllowfrom.example.com</Location>默认访问地址http://site/server-statusnginx..
分类:
Web程序 时间:
2014-08-11 15:20:53
阅读次数:
272
快速排序是一种效率比较高的算法,算法的思想是取出待排序中的一个元素,想办法将小于他的元素交换到他的左边,大于他的元素交换于他的右侧,然后对左右两侧再分别递归进行上述过程,直到左右两侧的元素只有一个。从而实现了整体的排序。c++实现的代码如下:
//快速排序(递归)
template
void quick_sort(T *arr,int b,int e)
{
if(b<e)
{ ...
分类:
其他好文 时间:
2014-08-11 15:00:42
阅读次数:
210
问题:Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"(((...
分类:
其他好文 时间:
2014-08-11 14:31:22
阅读次数:
169