所以,在程序开始遍历这些文件的时候,假设为了确定目录的总大小,就必须逐一重新查询文件系统。
So when the program starts to loop through the files, perhaps to determine the directories overall size, it has to requery the file system one by one.
假设一个不同的场景,系统要遍历相同的集合,但是要执行不同的操作。
Given a different scenario, the system would traverse the same collection but perform a different action.
例如,假设您有一个应用程序,它必须遍历数据库中大量行。
For example, imagine that you have an application that must iterate through a very large number of rows in a database.
这个简单的函数遍历data(假设data为一个容纳有数字数据的python容器),计算一组数据的平均值,然后返回值。
This simple function steps through the data (which is assumed to be a Python container holding numerical data), calculates the mean value of the set of data, then returns the value.
我缓慢的思维的触角只能一步步的推演假设,在因果逻辑的迷宫里缓步探索,而磁性内存遍历这一切只需要十亿分之一秒。
I cannot prevent the slow tentacles of my mind from advancing one hypothesis at a time, exploring labyrinths of consequence that magnetic memories would run through in a nanosecond.
假设你需用栈来实现遍历树的数据结构。
For example, imagine you need a data structure for tree traversal and choose to write a stack.
假设你需用栈来实现遍历树的数据结构。
For example, imagine you need a data structure for tree traversal and choose to write a stack.
应用推荐