case语句的哈希表方法

ACM-SE 20 Pub Date : 1982-04-01 DOI:10.1145/503896.503932
J. Gait
{"title":"case语句的哈希表方法","authors":"J. Gait","doi":"10.1145/503896.503932","DOIUrl":null,"url":null,"abstract":"The CASE statement evaluates an expression, selects an action according to the value of the expression and then executes the action. The most efficient runtime behavior is exhibited when the action can be selected via a jump table, which provides an entry for every possible value in the range of the expression but has execution time that is constant as the number of cases increases. If the range of the expression is too large then the jump table becomes impractical because of excessive space requirements. Implementations of the CASE statement that limit table size to increase linearly with the number of cases either require linear execution time or capitalize on the subrange structure of the expression to reduce the time requirement. Hash methods also limit space requirements, and in the case of hashing with chaining to resolve collisions can provide log n time performance. Open addressing methods provide constant time performance as the number of cases increases and, since the hash table is static and can be closely packed in an optimal fashion, the execution time can be limited to an average of less than two probes per selection even for closely packed tables. Open addressing in optimally packed tables leads to selection of the default case in fewer than eight probes. One can choose a hash function that facilitates extension of allowed data types from the usual byte and integer types to strings and double precision integers with minimal penalty in execution time.","PeriodicalId":184493,"journal":{"name":"ACM-SE 20","volume":"775 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1982-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":"{\"title\":\"Hash table methods for case statements\",\"authors\":\"J. Gait\",\"doi\":\"10.1145/503896.503932\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"The CASE statement evaluates an expression, selects an action according to the value of the expression and then executes the action. The most efficient runtime behavior is exhibited when the action can be selected via a jump table, which provides an entry for every possible value in the range of the expression but has execution time that is constant as the number of cases increases. If the range of the expression is too large then the jump table becomes impractical because of excessive space requirements. Implementations of the CASE statement that limit table size to increase linearly with the number of cases either require linear execution time or capitalize on the subrange structure of the expression to reduce the time requirement. Hash methods also limit space requirements, and in the case of hashing with chaining to resolve collisions can provide log n time performance. Open addressing methods provide constant time performance as the number of cases increases and, since the hash table is static and can be closely packed in an optimal fashion, the execution time can be limited to an average of less than two probes per selection even for closely packed tables. Open addressing in optimally packed tables leads to selection of the default case in fewer than eight probes. One can choose a hash function that facilitates extension of allowed data types from the usual byte and integer types to strings and double precision integers with minimal penalty in execution time.\",\"PeriodicalId\":184493,\"journal\":{\"name\":\"ACM-SE 20\",\"volume\":\"775 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"1982-04-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"2\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"ACM-SE 20\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/503896.503932\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"ACM-SE 20","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/503896.503932","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2

摘要

CASE语句计算表达式,根据表达式的值选择一个操作,然后执行该操作。当可以通过跳转表选择动作时,最有效的运行时行为被展示出来,跳转表为表达式范围内的每个可能值提供了一个条目,但是随着案例数量的增加,执行时间是恒定的。如果表达式的范围太大,则由于空间需求过大,跳转表将变得不切实际。限制表大小随案例数量线性增加的CASE语句的实现要么需要线性执行时间,要么利用表达式的子范围结构来减少时间需求。哈希方法还限制了空间需求,并且在使用链列哈希来解决冲突的情况下,可以提供log n时间的性能。随着情况的增加,开放寻址方法提供恒定的时间性能,并且由于哈希表是静态的,可以以最佳方式紧密打包,因此即使对于紧密打包的表,每次选择的执行时间也可以限制在平均少于两个探测。在最佳封装表中的开放寻址导致在少于8个探测中选择默认情况。可以选择一个哈希函数,它可以方便地将允许的数据类型从通常的字节和整数类型扩展到字符串和双精度整数,并且在执行时间上的损失最小。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
Hash table methods for case statements
The CASE statement evaluates an expression, selects an action according to the value of the expression and then executes the action. The most efficient runtime behavior is exhibited when the action can be selected via a jump table, which provides an entry for every possible value in the range of the expression but has execution time that is constant as the number of cases increases. If the range of the expression is too large then the jump table becomes impractical because of excessive space requirements. Implementations of the CASE statement that limit table size to increase linearly with the number of cases either require linear execution time or capitalize on the subrange structure of the expression to reduce the time requirement. Hash methods also limit space requirements, and in the case of hashing with chaining to resolve collisions can provide log n time performance. Open addressing methods provide constant time performance as the number of cases increases and, since the hash table is static and can be closely packed in an optimal fashion, the execution time can be limited to an average of less than two probes per selection even for closely packed tables. Open addressing in optimally packed tables leads to selection of the default case in fewer than eight probes. One can choose a hash function that facilitates extension of allowed data types from the usual byte and integer types to strings and double precision integers with minimal penalty in execution time.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
EPA - HERL/RTP: a DBMS application using word processing Computer graphics animation of the Tellico Reservoir water temperature simulation Realization of a translator for Janus Synthesizing abstract data type specifications An alternate approach to formal parsing methods
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1