小编use*_*840的帖子

TextUpdate和TextChanged事件有什么区别?

对于每个控件都有很多事件,两个非常相似,如Text Update和Text Changed,唔是不同的?

c# event-handling textchanged

13
推荐指数
1
解决办法
1万
查看次数

什么时间复杂度有一个函数,使用BST对结构数组进行排序?

我有一个使用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)

c sorting algorithm time-complexity binary-search-tree

1
推荐指数
1
解决办法
83
查看次数