数组模拟二叉搜索树

void build(int idx,int x)
{
	if(a[idx]==0)	a[idx]=x;
	else if(x>a[idx])	build(idx<<1|1,x);
	else if(x<a[idx])	build(idx<<1,x);
}
	
发布了180 篇原创文章 · 获赞 22 · 访问量 8979

猜你喜欢

转载自blog.csdn.net/qq_44622401/article/details/104582004
今日推荐