Open protik77 opened 4 years ago
@protik77 Your description seems accurate, but it doesn't seem to cause any error in executing the pseudocode. In the situation you described, the loop body is simply skipped and not executed. This seems to be the case not only in this pseudocode, but also in popular programming languages such as Python or C. For example, the following Python loop will never execute the print statement in the loop body.
for i in range(1, 1):
print('you will never see this message')
Neither will the following C loop ever execute the printf statement in the loop body.
for (int i = 1; i < 1; ++i)
printf("you will never see this message\n");
Note that the two loops above are arguably the closest implementation of the one used in the pseudocode, that is, for i <- 1 to 0
这是来自QQ邮箱的假期自动回复邮件。你好,我最近正在休假中,无法亲自回复你的邮件。我将在假期结束后,尽快给你回复。
Chapter number or note title: Chapter 2, Figure 2.2
Page number: 73
Error description: The line 6 of the pseudocode reads
for i <- 1 to r-1
. The first call would bePlaceQueens(Q[1..n],1)
wherer=1
. This sets the line 6 to,for i <- 1 to 0
.Suggested fix (if any): NA.