I don't know about document (Design and Implementation of 4.4 BSD Unix by Sam Leffler might be a good source, but I don't have it handy) but have a look at this C code: http://cpansearch.perl.org/src/PHILIPP/Net-Patricia-1.15_07/libpatricia/patricia.c
If you're good at C you can probably consider it a document.