2006-04-30

The devil is in the details: assertions

I've been debugging my btree removal code for the last 2 days. Assertions (#include <assert.h>), together with suitable printf() debugging, have proven as an invaluable tool during the process.

The code is after the purely textual description of the BTree data structure in Knuth's volume 3. There he says that "removal is only slightly more complicated than insertion". That might (actually, is) so on a conceptual level. But, when translated into code: aroud 4x more code, around that much more time and a number of corner-cases.

I've run the code through valgrind and I have no errors. Wow! :)

Tags:

1 comment:

Anonymous said...

pozdrav!
oprosti sto ovako upadam, no ne vidim drugog nacina obzirom da ne mogu naci tvoj mejl na sajtu.
javljam se u vezi projekta FLOSSworld www.flossworld.org. multimedijalni institut trazi domace developere koji bi bili voljni odgovoriti na jednu online anketu fezanu uz free/open source soft. ako si zainteresiran javi mi se, jer bih trebao tvoje bazicne podatke (ime, prezime, nick, e-mail) proslijediti mastriskom ekonomskom institutu za inovacije i tehnologiju kako bi ti mogli poslati username i password.
ako imas pitanja slobodno se javi.

marko@mi2.hr