对于每个控件都有很多事件,两个非常相似,如Text Update和Text Changed,唔是不同的?
我有一个使用BST对数组进行排序的函数.首先,我使用for循环和函数插入创建树(在树中插入数据保持有序)然后我按顺序访问树并在排序模式下将每个节点复制到新的临时存档中.这是我的代码:
double btree_sort(SPerson Archive[], unsigned int ne, double *btree_creating_time)
{
int i = 0;
TBinaryTree BinaryTree = NULL;
cont = 0;
LARGE_INTEGER freq;
LARGE_INTEGER t0, tF, tDiff;
QueryPerformanceFrequency(&freq);
QueryPerformanceCounter(&t0);
/*Algorithm*/
for (i = 0; i < ne; i++) /*Creating B-Tree*/
BinaryTree = binarytree_insert(BinaryTree, Archive[i]);
QueryPerformanceCounter(&tF);
tDiff.QuadPart = tF.QuadPart - t0.QuadPart;
*btree_creating_time = tDiff.QuadPart / (double)freq.QuadPart;
QueryPerformanceFrequency(&freq);
QueryPerformanceCounter(&t0);
inorder(BinaryTree, Archive);
/*end*/
QueryPerformanceCounter(&tF);
tDiff.QuadPart = tF.QuadPart - t0.QuadPart;
free(BinaryTree);
return tDiff.QuadPart / (double)freq.QuadPart;
}
int inorder(TBinaryTree BinaryTree, SPerson Archive[])
{
if (BinaryTree) …Run Code Online (Sandbox Code Playgroud)