I'm not a mathematician, I'm a computer science student, and I'm attending to a course called Advanced Functional Programming. There's this homework where I need to implement the Hilbert R-tree data type. In case any of you are not familiar with this structure, it is used to store spatial data, and it is very good for being queried, since it shows a nice overall performance (Here you can find more info on this structure).
The thing is, I do understand how the structure works, but it uses the Hilbert distance as the key for sorting the info within the structure. Actually, I've found an implementation of the Hilbert distance algorithm in Haskell (which happens to be the language that I'll be using on my homework), and I'm allowed to use it as long as I make reference to the original author. It works, but I don't quite understand how does this algorithm work, and I would really like to.
Could anyone please explain me in a simple way how does this work?
Since this question has to do more with the mathematical background of the algorithm instead of with the implementation, I decided to post my question here instead of in StackOverflow; but, in any case, I'm not mathematician, so please be gentle in your explanation =)