原题地址:https://oj.leetcode.com/problems/search-for-a-range/题意:Given
a sorted array of integers, find the starting and ending position of a given
target ...
分类:
编程语言 时间:
2014-06-08 21:03:21
阅读次数:
297
一:使用选择排序法对一维数组进行排序,截图/*选择排序的个人理解:
第一遍筛选,选出其中最大的值,得到值和下标 将最大的值的位置和数组的第一个位置交换 从数组的第二个位置开始第二遍筛选 将其中最大的值的位置和数组的第二个位置交换
直到筛选完数组 */二:代码using Syste...
分类:
其他好文 时间:
2014-06-08 21:01:12
阅读次数:
264
原题地址:https://oj.leetcode.com/problems/sort-colors/题意:Given
an array withnobjects colored red, white or blue, sort them so that objects of
the same col...
分类:
编程语言 时间:
2014-06-08 20:56:32
阅读次数:
394
写了个函数指针,这题目很水,但是佷烦。 1 #include 2 #include 3
#include 4 #include 5 using namespace std; 6 7 #define MAXN 305 8 9 typedef
struct {10 int id, g...
分类:
其他好文 时间:
2014-06-08 20:55:48
阅读次数:
202
#include #include #include #include using
namespace std;int cmp(const void *a,const void *b){ return *(int *)a-*(int
*)b;}int main(){ int n; ...
分类:
其他好文 时间:
2014-06-08 20:51:16
阅读次数:
202
插入排序(上)
基本思想:每次将一个待排序的的元素,按其关键字大小插入到已经排好序的子表的适当位置,直到全部元素插完为止。直接插入排序简写排序思路:
假设待排序的元素存放在R[0.....n-1]中,在排序过程中,将R划分为两个区间,分别为R[0.....i-1]和R[i....n-1](刚开始时....
分类:
其他好文 时间:
2014-06-08 20:50:06
阅读次数:
245
原题地址:https://oj.leetcode.com/problems/add-binary/题意:Given
two binary strings, return their sum (also a binary string).For example,a ="11"b
="1"Return"...
分类:
编程语言 时间:
2014-06-08 20:28:04
阅读次数:
300
url编码分两种, 一种是unicode, 另一种是gb2312,
今天遇到的一个网站是要将字符编码按照gb2312来编码,用来得到一个先填写blanks后再返回页面的数据,废话少说,需要做的就是先查看你的python的编码是啥,默认是ascii,import
sysprint sys.getd.....
分类:
编程语言 时间:
2014-06-08 20:17:26
阅读次数:
342
这里简短的总结一下而不是完全的罗列python的re模块,python的re具有强大的功能,如下是一个从我们学校抓取数据然后拆分的程序,代码如下:import
httplibimport urllibimport reimport sysreload(sys)sys.setdefaultencodi...
分类:
编程语言 时间:
2014-06-08 19:33:35
阅读次数:
333
使用python编写的脚本应用程序,在运行的时候需要有python的运行环境,但是我们肯定是希望整个python程序能够像应用程序一样打包生成一个包括其运行环境的exe文件包,这是第一步,但是要想使用net
start这样的方式启动, 还需要将该exe注册到服务里面去,使用exe install.....
分类:
编程语言 时间:
2014-06-08 19:27:50
阅读次数:
254