Welcome!
To use the personalized features of this site, please log in or register.
If you have forgotten your username or password, we can help.
My Menu
Saved Items

Resizable Arrays in Optimal Time and Space

Andrej Brodnik7, 8 Contact Information, Svante CarlssonContact Information, Erik D. DemaineContact Information, J. Ian Ian MunroContact Information and Robert Sedgewick10 Contact Information

(7)  Dept. of Theoretical Computer Science, Institute of Mathematics, Physics, and Mechanics, Jadranska 19, 1111 Ljubljana, Slovenia
(8)  Dept. of Computer Science and Electrical Engineering, Luleå University of Technology, S-971 87 Luleå, Sweden
(9)  Dept. of Computer Science, University of Waterloo, Waterloo, Ontario, N2L 3G1, Canada
(10)  Dept. of Computer Science, Princeton University, Princeton, NJ 08544, USA
Abstract
We present simple, practical and efficient data structures for the fundamental problem of maintaining a resizable one-dimensional array, A[l..l + n1], of fixed-size elements, as elements are added to or removed from one or both ends. Our structures also support access to the element in position i. All operations are performed in constant time. The extra space (i.e., the space used past storing the n current elements) is O(√n) at any point in time. This is shown to be within a constant factor of optimal, even if there are no constraints on the time. If desired, each memory block can be made to have size 2kc for a specified constant c, and hence the scheme works effectively with the buddy system. The data structures can be used to solve a variety of problems with optimal bounds on time and extra storage. These include stacks, queues, randomized queues, priority queues, and deques.

Contact Information Andrej Brodnik
Email: Andrej.Brodnik@IMFM.Uni-Lj.SI

Contact Information Svante Carlsson
Email: svante@sm.luth.se

Contact Information Erik D. Demaine
Email: eddemaine@uwaterloo.ca

Contact Information J. Ian Ian Munro
Email: imunro@uwaterloo.ca

Contact Information Robert Sedgewick
Email: rs@cs.princeton.edu
Fulltext Preview (Small, Large)
Image of the first page of the fulltext

References secured to subscribers.



Export this chapter
Export this chapter as RIS | Text
 
Remote Address: 38.107.191.105 • Server: mpweb05
HTTP User Agent: CCBot/1.0 (+http://www.commoncrawl.org/bot.html)