Skip to content

Commit 2dfca3c

Browse files
witcxchappyleaf.cx
and
happyleaf.cx
authored
将队列表述得更清晰 (#619)
Co-authored-by: happyleaf.cx <[email protected]>
1 parent 11a6ac3 commit 2dfca3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/book/16-Validating-Your-Code.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ assert invariant();
555555
}
556556
```
557557

558-
**in** 计数器指示数组中下一个对象所在的位置**out** 计数器指示下一个对象来自何处**wrapped** 的flag表示 **in** 已经“绕着圆圈”走了,现在从后面出来了。当**in****out** 重合时,队列为空(如果包装为 **false** )或满(如果 **wrapped****true** )。
558+
**in** 计数器指示数组中下一个入队对象所在的位置**out** 计数器指示下一个出队对象来自何处**wrapped** 的flag表示入队和出队指针顺序是否变换, 为**false** 表示**in****out**之前,为**true**则顺序相反。当**in****out** 重合时,队列为空(如果**wrapped** **false** )或满(如果 **wrapped****true** )。
559559

560560
**put()****get()** 方法调用 **precondition()****postcondition()**, 和 **invariant**(),这些都是在类中定义的私有方法。前置**precondition()****postcondition()** 是用来阐明代码的辅助方法。
561561

0 commit comments

Comments
 (0)