51CTO博客开发
#include <vector>using namespace std;#define MAX_NODES 1024vector<int> tree[MAX_NODES];int ancestor[MAX_NODES];int visited[MAX_NODES];int question[MAX_NODES][MAX_NODES];void Init(int node1
// Begin from a[1]void MaxHeapify(int *a, int index, int len){ int l = index * 2; int r = index * 2 + 1; int largest = -1; if (l <= le
void Exchange(int a[], int i, int j){ if (i != j) { int tmp = a[i]; a[i] = a[j]; a[j] = tmp; }}int
int* kmp_next(char p[]){ int len = strlen(p); int *next = new int[len]; memset(next, 0, sizeof(int) * len); next[0] = -1; next[1] = 0;  
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号