Code
int NumInsert = 100000;
int temp_random[NumInsert];
int temp;
for (i=0; i < NumInsert; i++)
{
temp_random[i]=0;
}
for(i = 0; i < NumInsert; i++)
{
srand(i);
while(1)
{
temp=random()%NumInsert;
if(temp_random[temp]==0)
{
XKey=XPtr=temp;
printf("NO.%6d insert key velue: %d and %d.\n", i, XKey, XPtr);
RetnCode = Insert(XEntryNum, XKey, XPtr);
temp_random[temp]=1; //这里是赋值,不是判断。
break;
}
}
}
int NumInsert = 100000;
int temp_random[NumInsert];
int temp;
for (i=0; i < NumInsert; i++)
{
temp_random[i]=0;
}
for(i = 0; i < NumInsert; i++)
{
srand(i);
while(1)
{
temp=random()%NumInsert;
if(temp_random[temp]==0)
{
XKey=XPtr=temp;
printf("NO.%6d insert key velue: %d and %d.\n", i, XKey, XPtr);
RetnCode = Insert(XEntryNum, XKey, XPtr);
temp_random[temp]=1; //这里是赋值,不是判断。
break;
}
}
}