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.
|
 |
Resizable Arrays in Optimal Time and Space
| |
|
Resizable Arrays in Optimal Time and Space
Andrej Brodnik7, 8 , Svante Carlsson8 , Erik D. Demaine9 , J. Ian Ian Munro9 and Robert Sedgewick10 
| (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 + n − 1], 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 2k − c 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.
Fulltext Preview (Small, Large)
 References secured to subscribers.
|
|
|
|
|
|