예제 #1
0
파일: radix.c 프로젝트: taysom/tau
void insert (tree_s *tree, u32 x)
{
	bucket_s	*bucket = &tree->t_root;

	++Adds;
	insert_bucket(bucket, x, START_SHIFT);
}
예제 #2
0
파일: radix.c 프로젝트: taysom/tau
void insert_node (bucket_s *bucket, u32 x, u32 shift)
{
	node_s	*node = bucket->b_node;
	unint	i = ith(x, shift);

	insert_bucket( &node->n_bucket[i], x, shift - BUCKET_SHIFT);
}
예제 #3
0
void bucket_sort(int *list, int l, int r)
{
    int i, size, max=0;
    for (i = l; i <= r; i ++)
        if (list[i]>max)
            max = list[i];
    size = max/10;
    init_bucket(size);
    insert_bucket(list, l, r);
    sort_bucket(list, size);
    del_bucket(size);
}