int main(int argc, char ** argv)
{

	ds d = ds_init();
	
	for (int i = 0; i < 100; i++)
		insert_d(d, f(i));

	delete_d(d, 1337);
	
	for (int i = 0; i < 10000; i++)
		insert_d(d, f(i));

	delete_max_d(d);

	return 0;
}
예제 #2
0
int main()
{
	ds d;

	for(int i = 0; i < 20; i++)
	{
		insert_d(d, i);
	}

	printf("%d\n", max_d(d));
}
int main()
{
	ds d1;

	for(int i = 0; i < 20; i++)
	{
		insert_d(d1, i);
		printf("%d\n", search_d(d1, i));
		update_d(d1, i, 2*i);
	}

	printf("%d\n", max_d(d1));
}
int main()
{
	ds d1;
	ds d2;
	for(int i = 0; i < 20; i++)
	{
		insert_d(d1, i);
	}

	for(int i = 0; i < 10; i++)
	{
		insert_d(d2, i);
		update_d(d1, i, 2*i);
	}

	for(int i = 0; i < 5; i++)
	{
		delete_max_d(d1);
		delete_max_d(d2);
	}

	printf("%d\n", max_d(d1));
}
int main(int argc, char **argv)
{
	ds d = init_d();

	for(int i = 0; i < n; i++)
		insert_d(d, i, 0);

	delete_max_d(d, 1);
	delete_min_d(d, 1);

	for(int i = 0; i < x; i++)
		search_d(d, i, x);

}
예제 #6
0
int main(){
   int a[9] = {6,2,2,9,4,7,2,5,8};
   int i;
   
   tree_d t1 = NULL;
   for(i = 0; i < sizeof( a ) / sizeof( a[0] ); i++)
      insert_d( t1 , a[i] );

   puts("InOrden");
   inOrderPrint_d( t1 );   
   printf("\nTamanio: %d", tree_size_d( t1 ) );
   printf("\nSuma: %d", tree_sum_d( t1 ) );
   printf("\nProfundidad: %d", tree_depth_d( t1 ) );
   printf("\nOcurrencia de 2: %d",
          times_in_tree_d( t1 , 2 ) );
   
   return 0;
}