- 博客(18)
- 资源 (6)
- 收藏
- 关注
原创 [转] Delaunay三角剖分理论知识
1.Delaunay三角剖分&Voronoi图定义 2.计算Delaunay三角剖分的算法及分析 3.例子程序&代码 大话 点集的三角剖分(Triangulation),对数值分析(比如有限元分析)以及图形学来说,都是极为重要的一项预处理技术。 尤其是Delauna
2011-08-31 11:10:13 5664 1
原创 [POJ_1008]Maya Calendar
#include #include #include #include using namespace std; string maya_month[] = { "pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin",
2011-08-24 16:34:39 487
原创 [POJ_1007] DNA Sorting
#include #include #include using namespace std; const int TEMP_SIZE = 1024; char temp_buffer[TEMP_SIZE]; void print_array(char* array
2011-08-24 15:31:41 334
原创 归并排序
#include using namespace std; const int TEMP_SIZE = 1024; int temp_buffer[TEMP_SIZE]; void print_array(int* array, int size) { for (in
2011-08-24 14:31:01 253
原创 最小堆算法求Top K
#include using namespace std; #define SIZE 10 #define K 5 void heapify(int* array, int size, int i) { int left = i * 2 + 1; int right =
2011-08-24 13:58:18 568
原创 [OpenJudge]胡
#include using namespace std; const int MAX_SIZE = 14; int g_elements[MAX_SIZE] = {1,1,2,3,3,4,4,5,6,6,6,7,8,9}; bool g_visited[MAX_SIZE]
2011-08-24 13:18:10 2783
原创 [POJ_1003]Hangover
#include using namespace std; const int SIZE = 1000; float table[SIZE]; int cal_size = 1; int inc = 50; void build_table_to(int newSize)
2011-08-23 15:24:30 292
原创 [POJ_1002]487-3279
#include #include #include using namespace std; class bnode { public: bnode() { left = right = 0; val = -1; cnt = 2; } public:
2011-08-23 13:51:00 271
原创 [POJ_1088]滑雪
#include using namespace std; int* data; int* track; int row, col, size; int best_length = 0; /* void print_data(int* array) { for (int
2011-08-23 10:56:59 329
原创 push, pop, min 都为O(1)的栈
#include #include using namespace std; // O(1): push, pop, min class MinStack { public: virtual void Push(int x) = 0; virtual int Pop()
2011-08-22 17:32:06 351
原创 找出数组从小到大的前N个数
#include using namespace std; void print_array(int* array, int size) { for (int i=0; i<size; i++) cout << array[i] << " "; cout << end
2011-08-22 16:30:29 494
原创 在排序数组中寻找两个数使其和等于给定数
#include using namespace std; void print_array(int* array, int size) { for (int i=0; i<size; i++) cout << array[i] << " "; cout << en
2011-08-22 15:52:30 289
原创 桶排序
#include using namespace std; class listnode { public: int elem; listnode* next; listnode() { next = 0; } }; class list { public:
2011-08-19 16:22:27 263
原创 计数排序
#include using namespace std; void print_array(int* array, int size) { for (int i=0; i<size; i++) cout << array[i] << " "; cout << e
2011-08-19 16:22:07 318
原创 堆排序
#include using namespace std; void print_array(int* array, int size); void build_heap(int* array, int size); void swap(int& a, int& b); voi
2011-08-19 16:21:38 208
原创 最大值&最小值
#include using namespace std; void print_array(int* array, int size) { for (int i=0; i<size; i++) cout << array[i] << " "; cout <<
2011-08-19 16:21:04 363
原创 基数排序
#include using namespace std; void print_array(int* array, int size) { for (int i=0; i<size; i++) cout << array[i] << " "; cout <<
2011-08-19 16:20:17 212
原创 快速排序
#include using namespace std; void print_array(int* array, int size) { for (int i=0; i<size; i++) cout << array[i] << " "; cout << e
2011-08-19 16:19:15 273
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人