Article View: comp.lang.c++.leda
Article #141Random access to ditionaries.
From: Alex Beascoechea
Date: Wed, 18 Oct 1995 20:13
Date: Wed, 18 Oct 1995 20:13
17 lines
1326 bytes
1326 bytes
I was trying to find a way to randomly access one element in one of LEDA's dictionary structures. If a data structure is sorted by a linear order I would like to efficiently access an element between 1..struct.size() maybe using the array indirection operator. At the same time that insertion/deletion/search keep being efficient. E.g. give me the jth item in the sorted sequence A should be something like A[j]. In particular I do not see why this could not be part of the sortseq interface, and the access can probably be O(nlogn) , maybe adding some field to the implementation? The only way I see I could get access to the jth element now is by traversing the data structure from the begining using the succ method j times. Or maybe I am missing something?
Technical Details
Message-ID:
<463n59$17j@usenet.rpi.edu>Path:
arc1-ca.pugleaf.net!library.erc.clarkson.edu!rpi!usenetShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!library.erc.clarkson.edu!rpi!usenet From: Alex Beascoechea <alex@cat.rpi.edu> Newsgroups: comp.lang.c++.leda Subject: Random access to ditionaries. Date: 18 Oct 1995 20:13:29 GMT Organization: Rensselaer Polytechnic Institute Message-ID: <463n59$17j@usenet.rpi.edu> NNTP-Posting-Host: corning.cat.rpi.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.12 (X11; I; SunOS 5.3 sun4m) X-URL: news:comp.lang.c++.leda#MALIK.95Oct18133208@serv-402.dfki.uni-kl.de