Errata

Think Data Structures

Errata for Think Data Structures

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 54
WikiFetcher code

I already wrote to Allen Downey about this - but I want to make sure that this does not get lost in 100s of emails we get these days.

This is not really an error - the program behaves as designed but I am sure many readers of this book will not spend enough time to investigate and might put blame on the author or the publisher - may even put some nasty comments on Amazon.com pushing some potential buyers away which will be such a shame because

THIS IS AN AMAZINGLY WELL WRITTEN BOOK.

I am executing the class Class WikiPhilosophy.

When you start with https://en.wikipedia.org/wiki/Java_(programming_language) as the source URL,
the Third URL that is parsed for content (https://en.wikipedia.org/wiki/Computer_language) has only one PARAGRAPH element,
<p>A <b>computer language</b> is a system of communication with a computer. Types of computer languages include these:</p>

And it has no hyperlinks inside, the hyperlinks are kept outside of the paragraph as a list – the method WikiFetcher.fetchWikipedia (String url)
faithfully comes out saying it found no links (in <p>). In other Wikipedia pages the lists are kept under PARAGRAPHS.

So basically what Allen says on page 56 last paragraph point#4 ("after following 7 links you should get to Philosophy" does not happen because most probably the wikipedia page was changed.


I tested the program with a different input –

public static void main(String[] args) throws IOException {
String destination = "https://en.wikipedia.org/wiki/Philosophy";
String source = "https://en.wikipedia.org/wiki/Philosopher";
testConjecture(destination, source, 10);
}

And it works fine –

Fetching https://en.wikipedia.org/wiki/Philosopher...
**philosophy**
Eureka!

Thank you.

Regards,
Sumant

sumant kumar  May 07, 2019