algorithm - "word"在分析计算机算法中的意义

标签 algorithm language-agnostic clrs

我正在阅读 "Introduction to Algorithms" , 第三版。在“分析算法”部分下写道:

We also assume a limit on the size of each word of data. For example when working with inputs of size n, we typically assume that integers are represented by c lg n bits for some constant c>=1. We require c>=1 so that each word can hold the value of n, enabling us to index the individual input elements, and we restrict c to be a constant so that the word size doesn't grow arbitrarily.

这里的“字”字是什么意思?这是用“词”表示数据的标准吗?

最佳答案

它们表示一个机器词;基本上是处理器寄存器的大小,或者该机器的一段数据的“最自然大小”。对于 32 位机器,它是 32 位;对于 64 位机器,它是(毫不奇怪)64 位。

随着计算机体系结构的发展,字的大小过去变得更加可变。如果你看this Wikipedia article关于字长,您会看到指向 12 位、18 位、21 位、24 位、31 位、36 位、48 位和 60 位硬件描述的链接。我记得曾经读过有关 72 位机器的文章,尽管我现在找不到引用资料。

关于algorithm - "word"在分析计算机算法中的意义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11493565/

相关文章:

python - "Confused Digger"算法运行太慢,有什么办法可以加快速度?

ruby - 如何仅通过多个对象的唯一组合进行迭代?

c++ - 通过递归使用中点位移算法

language-agnostic - 抽象基类何时可以拥有(非静态)数据成员?

c++ - 学习按位编程的资源?

c - 建议的阅读顺序和其他问题

algorithm - 确定比较和交换指令列表是否会对长度为 N 的列表进行排序

language-agnostic - OO 设计,开放/封闭原则问题

algorithm - 什么时候能够计算增长顺序很重要?

algorithm - 在线性时间内打印出不相交集数据结构中的节点