Aug. 15th, 2012

izard: (Default)
AIMA by Russel and Norvig, Third edition, page 894.

CYK-Parse program
P <- array of size [M, N, N]
...
for length = 2 to N do
  for start = 1 to N - length + 1 do
    for len1 = 1 to N-1 do
      len2 <- length - len1
      ...
      reference to P[Z, start + len1, len2]
      ...

when length = 2 (first iteration of outer loop), start = N-1 (last iteration of middle loop), and len1 = N-1 (last iteration of inner loop),
second index of the reference to P which is start + len1 equals
2*N - 2, that is out of the array bounds for N > 1

Shall I request a 2.56$ check or am I missing something trivial?

Profile

izard: (Default)
izard

July 2025

S M T W T F S
  12345
67 8 91011 12
13141516171819
20212223242526
2728293031  

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 15th, 2025 03:49 pm
Powered by Dreamwidth Studios