Sets, Multisets and… SQL

Those of you who paid attention at your ‘Introduction to Databases’ class will probably remember that SQL is based on Relational Algebra. Maybe you also remember that Relational Algebra operates on relations, which are a special category of sets. As such, they do not contain duplicates. An SQL table, however, can easily contain duplicate rows and therefore it’s …

Kinda Like Assert

In 1983 my math teacher wrote on the blackboard: P{Q}R. Ever since, my code is loaded with assertions. “Assertions should be used to document logically impossible situations and discover programming errors […] This is distinct from error handling: most error conditions are possible, although some may be extremely unlikely“. (Wikipedia) [Assertion] We all have seen, …

Pointer To Pointer

Some hold that pointers in a language like C are dangerous and hard to master. Both maybe true, but so are scalpels. Since you are reading this, you know that pointer practice makes pointer perfect. The same goes for pointers to pointers. I remember vividly when I first saw some elegant code that used a …

Skip List

The skip list is a relative unknown data structure. If you know it already you can stop reading. If not, keep reading because “the algorithms for insertion and deletion in skip lists are much simpler and significantly faster than equivalent algorithms for balanced trees.” (William Pugh) [Skip lists: a probabilistic alternative to balanced trees]. Speaking …