This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Mapping range of addresses
- From: Paul Koning <pkoning at equallogic dot com>
- To: shreyas76 at gmail dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 19 Sep 2005 10:26:31 -0400
- Subject: Re: Mapping range of addresses
- References: <24389fb305091907144aff7f60@mail.gmail.com>
>>>>> "shreyas" == shreyas krishnan <shreyas76@gmail.com> writes:
shreyas> Hi , I am looking for an efficient data structure to map
shreyas> from a range of addresses to a single address. As it is
shreyas> used at runtime, I want it to be as efficient as possible,
shreyas> with perhaps updaing more important that retreiving. Are
shreyas> there any examples of such data structure ( and optimized
shreyas> code to use it) in gcc,binutils ?
How many? Order of 10, or 1000, or a million?
Read some algorithms textbooks for ideas. Knuth vol. 3, Cormen
Leiserson Rivest "Introduction to Algorithms", etc.
AVL trees take O(log(N)) time for insert, delete, and lookup. Those
are often a nice solution.
paul