[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: fast Lua fifo for breadth-first search
- From: Dirk Laurie <dirk.laurie@...>
- Date: Thu, 23 Jan 2014 15:18:02 +0200
2014/1/23 Gaspard Bucher <gaspard@teti.ch>:
> I am working on a fast xml library (using RapidXML) and want to implement a
> simple search algorithm to find the first node with a given tag.
>
> From my own extensive use of such 'find' functions, the objects to find are
> usually near the surface so I want to avoid depth-first search.
Two thoughts:
1. Do you mean "first" according to some definition of precedence or "any"?
2. In either case, the overhead in creating a Lua table by tag (values being
nodes or arrays of nodes) may be compensated by Lua's fast hashtable
searching.