James Saiz : Blog James Saiz - 2005/07/19

James Saiz

journeyman of some

Blog James Saiz - 2005/07/19

Indexing Time

Dave Warnock and I have been talking about indexing entries in Leonardo by last updated time.

We want to be able to retrieve the entries between A and B, or the n entries after A or the n entries before B where A and B can be either ordinals or times.

I'm guessing the right way of doing it would be some sort of balanced tree.

The nature of the data is that insertions will almost entirely be at the end, retrieval will largely be at the end and deletions will probably be fairly distributed.

Just as a preliminary, I've written an unbalanced tree, although I haven't finished implementing the kinds of queries we want to be able to do on the tree.

Any suggestions on algorithms and/or implementations in Python?

Most implementations don't seem to come out of the box with the kind of "slice" queries we want to do (or even both key- and ordinal-based queries).

2005/07/19 : Categories leonardo Python algorithms : 0 trackbacks : 11 comments (permalink)


Content made available under a Creative Commons Attribution-NonCommercial-ShareAlike license