Skip to content

Commit 174c216

Browse files
Update
1 parent ce04091 commit 174c216

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

errata.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Errata, Corrections and Improvements
2+
----------------------------------------------------
3+
If you find any mistakes in the third edition of Hands On Data Structures and Algorithms with Python book, or if you have suggestions for improvements, then please [raise an issue in this repository]([https://github.com/PacktPublishing/JavaScript-from-Beginner-to-Professional/issues](https://github.com/PacktPublishing/Hands-On-Data-Structures-and-Algorithms-with-Python-Third-Edition/issues)), or email to us.
4+
5+
## Chapter 13, Page 403 - Fixing the reference to `ord` array
6+
7+
There should be a reference calling to the `ord` array as `ord_text` in the `generate_hash` function.
8+
9+
Incorrect code is:
10+
```
11+
else:
12+
hash_text[i] = ((hash_text[i-1] - ord_text[i-1]) + ord[i+len_pattern-1]) # calculating next hash value using previous value
13+
```
14+
Correct code is:
15+
```
16+
else:
17+
hash_text[i] = ((hash_text[i-1] - ord_text[i-1]) + ord_text[i+len_pattern-1]) # calculating next hash value using previous value
18+
```

0 commit comments

Comments
 (0)