简体   繁体   English

Garwick的用于处理堆栈溢出的算法?

[英]Garwick's algorithm for dealing with stack overflows?

Garwick's Algorithm is an algorithm for dealing with stack overflows. Garwick的算法是一种用于处理堆栈溢出的算法。

Does anybody have ideas on how to modify Garwick's algorithm for dealing with stack overflows? 是否有人对如何修改Garwick的算法以处理堆栈溢出有想法? The question is about coming up with an algorithm to speed up Garwick's algorithm. 问题在于提出一种算法来加快Garwick的算法。 In this case it would mean an algorithm that results with a smaller number of reallocations and a smaller number of cells moved? 在这种情况下,这将意味着一种算法,导致重新分配的数量减少并且移动的单元数减少了?

Standish (Data Structures, Algorithms, and Software Principles book) offers a table that gives the average number of reallocations and cells moved when dealing with 10 stacks and 1000 elements - elements are added by uniform distribution and a skewed distribution going with (1/2)^(-n), n = 1...10. Standish(《数据结构,算法和软件原理》书)提供了一张表格,该表格提供了处理10个堆栈和1000个元素时平均重新分配和移动的单元数-元素通过均匀分布和偏斜分布相加(1/2 )^(-n),n = 1 ... 10。

One suggested solution is to have even stacks grow in the left direction, and odd stacks in the right direction - I think this gave better results. 一个建议的解决方案是使偶数堆栈在左侧增加,而奇数堆栈在右侧增加-我认为这样可以提供更好的结果。

Has anybody come accross algorithms that are faster than Garwick's algorithm ? 有没有人遇到比Garwick算法更快的算法?

总体上,偶数堆栈向左生长,奇数堆栈向右生长。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM