Optimal Resizable Arrays

IF 1.2 3区 计算机科学 Q3 COMPUTER SCIENCE, THEORY & METHODS
Robert E. Tarjan, Uri Zwick
{"title":"Optimal Resizable Arrays","authors":"Robert E. Tarjan, Uri Zwick","doi":"10.1137/23m1575792","DOIUrl":null,"url":null,"abstract":"SIAM Journal on Computing, Volume 53, Issue 5, Page 1354-1380, October 2024. <br/> Abstract. A resizable array is an array that can grow and shrink by the addition or removal of items from its end, or both its ends, while still supporting constant-time access to each item stored in the array given its index. Since the size of an array, i.e., the number of items in it, varies over time, space-efficient maintenance of a resizable array requires dynamic memory management. A standard doubling technique allows the maintenance of an array of size [math] using only [math] space, with [math] amortized time, or even [math] worst-case time, per operation. Sitarski, and (apparently independently) Brodnik, Carlsson, Demaine, Munro, and Sedgewick describe much better solutions that maintain a resizable array of size [math] using only [math] space, still with [math] time per operation. Brodnik et al. give a simple proof that this is best possible. We distinguish between the space needed for storing a resizable array, and accessing its items, and the temporary space that may be needed while growing or shrinking the array. For every integer [math], we show that [math] space is sufficient for storing and accessing an array of size [math], if [math] space can be used briefly during grow and shrink operations. Accessing an item by index takes [math] worst-case time, while grow and shrink operations take [math] amortized time. Using an exact analysis of a growth game, we show that for any data structure from a wide class of data structures that uses only [math] space to store the array, the amortized cost of grow is [math], even if only grow and access operations are allowed. The time for grow and shrink operations cannot be made worst-case unless [math].","PeriodicalId":49532,"journal":{"name":"SIAM Journal on Computing","volume":"206 1","pages":""},"PeriodicalIF":1.2000,"publicationDate":"2024-09-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"SIAM Journal on Computing","FirstCategoryId":"94","ListUrlMain":"https://doi.org/10.1137/23m1575792","RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
引用次数: 0

Abstract

SIAM Journal on Computing, Volume 53, Issue 5, Page 1354-1380, October 2024.
Abstract. A resizable array is an array that can grow and shrink by the addition or removal of items from its end, or both its ends, while still supporting constant-time access to each item stored in the array given its index. Since the size of an array, i.e., the number of items in it, varies over time, space-efficient maintenance of a resizable array requires dynamic memory management. A standard doubling technique allows the maintenance of an array of size [math] using only [math] space, with [math] amortized time, or even [math] worst-case time, per operation. Sitarski, and (apparently independently) Brodnik, Carlsson, Demaine, Munro, and Sedgewick describe much better solutions that maintain a resizable array of size [math] using only [math] space, still with [math] time per operation. Brodnik et al. give a simple proof that this is best possible. We distinguish between the space needed for storing a resizable array, and accessing its items, and the temporary space that may be needed while growing or shrinking the array. For every integer [math], we show that [math] space is sufficient for storing and accessing an array of size [math], if [math] space can be used briefly during grow and shrink operations. Accessing an item by index takes [math] worst-case time, while grow and shrink operations take [math] amortized time. Using an exact analysis of a growth game, we show that for any data structure from a wide class of data structures that uses only [math] space to store the array, the amortized cost of grow is [math], even if only grow and access operations are allowed. The time for grow and shrink operations cannot be made worst-case unless [math].
最佳可调整阵列
SIAM 计算期刊》,第 53 卷第 5 期,第 1354-1380 页,2024 年 10 月。 摘要可调整大小的数组是一种数组,它可以通过增加或移除其末端或两端的项目来实现增长和收缩,同时仍然支持在给定索引的情况下对数组中存储的每个项目进行恒定时间访问。由于数组的大小(即其中的项数)会随时间而变化,因此需要对可调整大小的数组进行动态内存管理,才能实现空间效率维护。标准的加倍技术只需[数学]空间就能维护大小为[数学]的数组,每次操作只需[数学]摊销时间,甚至[数学]最坏情况下的时间。Sitarski 和 Brodnik、Carlsson、Demaine、Munro 和 Sedgewick(显然是独立的)描述了更好的解决方案,只用[数学]空间就能维护一个大小为[数学]的可调整数组,每次操作仍然需要[数学]时间。布罗德尼克等人给出了一个简单的证明,即这是最好的解决方案。我们区分了存储可调整大小的数组和访问其项所需的空间,以及数组增长或收缩时可能需要的临时空间。对于每一个整数[math],我们证明,如果[math]空间可以在数组增长和收缩操作时短暂使用,那么[math]空间足以存储和访问大小为[math]的数组。通过索引访问一个项目需要[math]最坏情况时间,而增长和收缩操作需要[math]摊销时间。我们通过对增长游戏的精确分析表明,对于只使用[math]空间存储数组的各种数据结构,即使只允许进行增长和访问操作,增长的摊销成本也是[math]。除非[math],否则增长和收缩操作的时间无法达到最坏情况。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
SIAM Journal on Computing
SIAM Journal on Computing 工程技术-计算机:理论方法
CiteScore
4.60
自引率
0.00%
发文量
68
审稿时长
6-12 weeks
期刊介绍: The SIAM Journal on Computing aims to provide coverage of the most significant work going on in the mathematical and formal aspects of computer science and nonnumerical computing. Submissions must be clearly written and make a significant technical contribution. Topics include but are not limited to analysis and design of algorithms, algorithmic game theory, data structures, computational complexity, computational algebra, computational aspects of combinatorics and graph theory, computational biology, computational geometry, computational robotics, the mathematical aspects of programming languages, artificial intelligence, computational learning, databases, information retrieval, cryptography, networks, distributed computing, parallel algorithms, and computer architecture.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信