/归并[)升序
//使用链表合并思想
voidMerge(int*src,int*dest,intbegin1,intend1,intbegin2,intend2)
{
assert(src&&dest);
intindex=begin1;//两个区间挨着
while(begin1<end1&&begin2<end2)
{
if(src[begin1]<src[begin2])
{
dest[index..
分类:
编程语言 时间:
2016-03-27 15:57:15
阅读次数:
196
插入排序:直接插入,希尔排序选择排序:选择排序,堆排序交换排序:冒泡排序,快速排序归并排序:归并排序#include<iostream>
#include<assert.h>
usingnamespacestd;
voidInsertSort(int*arr,size_tsize)
{
assert(arr);
for(inti=0;i<size-1;++i)
{
int..
分类:
编程语言 时间:
2016-03-26 08:58:47
阅读次数:
184
在父字符串中查找子字符串(指针控制,也可选择标控制)#pragmaonce
#include<iostream>
#include<assert.h>
usingnamespacestd;
char*StrStr(char*source,char*dest)
{
assert(source&&dest);
if(strlen(source)<strlen(dest))
returnNULL;
char*..
分类:
其他好文 时间:
2016-03-26 08:16:03
阅读次数:
257
Python中的关键字包括如下:and del from not while as elif global or with assert else if pass yield break except import print class exec in raise continue finally is return def for lambda try你想看看有哪些关键字?OK,打开一个终端,就...
分类:
编程语言 时间:
2016-03-26 07:40:11
阅读次数:
258
循环双向链表的增删查改等基本操作#include<iostream>
#include<assert.h>
usingnamespacestd;
typedefintDataType;
structListNode
{
DataType_data;
ListNode*_prev;
ListNode*_next;
ListNode(constDataType&x)
:_data(x)
,_prev(NULL)
,_next(NU..
分类:
编程语言 时间:
2016-03-24 16:41:21
阅读次数:
415
string类的默认成员函数、增删查改实现#include<iostream>
#include<assert.h>
usingnamespacestd;
classString
{
public:
String(char*_str="")
//:p_str((char*)malloc(strlen(_str)+1))
//效果一样,但之前没考虑清楚,误打误撞对了,没注意,开辟空间应于_c..
分类:
其他好文 时间:
2016-03-24 16:39:23
阅读次数:
221
#include<iostream>
usingnamespacestd;
#include<assert.h>
classString
{
public:
String(char*str="")
{
_size=strlen(str);
_capacity=_size+1;
_str=newchar[_capacity];
strcpy(_str,str);
}
~String()
{
if(_str)
{
delete[]_str;
_size=0;
_capacity=0;
_s..
分类:
编程语言 时间:
2016-03-23 23:49:42
阅读次数:
412
#include<iostream>
#include<assert.h>
usingnamespacestd;
classDate
{
public:
Date(intyear=1900,intmonth=1,intday=1)
{
_year=year;
_month=month;
_day=day;
if(!CheckDate())
{
cout<<"输入日期为非法日期"<<endl;
assert(false);
}
}
Date(c..
分类:
编程语言 时间:
2016-03-23 23:41:58
阅读次数:
305
动态顺序表的初始化及增删查改#pragmaonce
#include<iostream>
#include<string.h>
#include<assert.h>
#include<stdlib.h>
typedefintDataType;
typedefstructSeqList
{
DataType*_array;
size_t_size;
size_t_capacity;
}SeqList;
voidInitSeqLis..
分类:
其他好文 时间:
2016-03-23 06:47:31
阅读次数:
246
代码比较通俗易懂,但是我还是在这个过程中浪费了不少时间,也算是看到了nodejs中异步的一个小坑。未来的坑还有很多,慢慢找坑填坑吧。 参考资料如下: 1、断言模块 : https://nodejs.org/api/assert.html 2、mongodb模块:https://github.com/
分类:
数据库 时间:
2016-03-22 00:34:14
阅读次数:
291