Rewrite Listing 12.18, WebCrawler.java, to improve the performance by using appropriate new data structures for listOfPendingURLs and

Question:

Rewrite Listing 12.18, WebCrawler.java, to improve the performance by using appropriate new data structures for listOfPendingURLs and listofTraversedURLs.

Suppose you have Java source files under the directories?chapter1,?chapter2, . . . ,?chapter34. Write a program to insert the statement?package chapteri;?as the first line for each Java source file under the directory?chapteri. Suppose?chapter1,?chapter2, . . . ,?chapter34?are under the root directory?srcRootDirectory. The root directory and?chapteri?directory may contain other folders and files. Use the following command to run the program:

java Exercise12_18 srcRootDirectory

Listing?WebCrawler.java

image

image

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: