LemonPi / data

Useful data structures
2 stars 1 forks source link

Error in rb tree implementation #1

Closed a1983 closed 9 years ago

a1983 commented 9 years ago

Such code not passed validation:

int main(int argc, char *argv[]) {
  sal::Basic_tree< int > s;
  s.insert( 3 );
  s.insert( 1 );
  s.insert( 2 );
  assert( s.valid() );
  return 0;
}

Unfortunately, I can't found what's wrong with algorithm.

LemonPi commented 9 years ago

Thanks - fixed in 7d1c5 and added it to datatest's tree_test unit testing. It was a problem with rb_insert_fixup using stale parent pointers.

LemonPi commented 9 years ago

Hey a1983, data has stopped being a submodule of sal, so I recommend you clone sal's repo instead, as changes will only be made there. This repository will eventually get discontinued.

a1983 commented 9 years ago

You are welcome. It seems ok now. P.S. Your library is pretty good.