- 博客(6)
- 资源 (1)
- 收藏
- 关注
原创 希尔排序(ShellSort)
时间复杂度O(n^1.25)~O(1.6n^1.25) 空间复杂度:O(1)#include<iostream>using namespace std;void ShellSort(int *arr, int size){ int gap = size; //两个数之间的距离 while (gap > 1) { gap = gap / 3 + 1;
2015-12-12 16:19:21 344
原创 简单的进度条
#include<stdio.h>#include<string.h>#include <windows.h>#define N 101void proc(){ int count = 0; char arr[N]; memset(arr, '\0', sizeof(arr)); char* lable = "|/-\\"; // '\'为转义字符若要输出‘\
2015-12-08 21:58:48 301
原创 插入排序
#include<iostream>using namespace std;void InsertSort(int* arr, int size){ for (int i = 1; i < size; i++) { int end = i - 1; while (arr[end] > arr[end + 1] && end >= 0)
2015-12-06 20:17:04 302
原创 单链表(c语言版)
SList.h#pragma once#include<stdio.h>#include<assert.h>#include<malloc.h>typedef int DataType ;typedef struct Node{ DataType data; struct Node* next;}Node, *PLinkList;void InitList(PLinkL
2015-12-06 17:35:46 391
原创 堆的实现及堆的各种应用
#include<iostream>#include<vector>using namespace std;template<class T>class Less //仿函数{public: Less() {} bool operator()(const T& l, const T& r) { return l < r; //实现小堆
2015-12-06 17:14:14 416
原创 用位图解决大数据存储
BitSet.h#include<iostream>#include<assert.h>using namespace std;class BitSet{public: BitSet(size_t N) //N表示存储数据的范围 { _size = N / 32 + 1; _arr = new size_t[_size]; me
2015-12-05 17:21:39 692
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人