04.02.2018 Views

Algorithms

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.5 ■ Applications<br />

513<br />

EXPERIMENTS<br />

3.5.30 Duplicates (revisited). Redo Exercise 2.5.31 using the Dedup filter given on<br />

page 490. Compare the running times of the two approaches. Then use Dedup to run the<br />

experiments for N = 10 7 , 10 8 , and10 9 , repeat the experiments for random long values<br />

and discuss the results.<br />

3.5.31 Spell checker. With the file dictionary.txt from the booksite as commandline<br />

argument, the BlackFilter client described on page 491 prints all misspelled words<br />

in a text file taken from standard input. Compare the performance of RedBlackBST,<br />

SeparateChainingHashST, and LinearProbingHashST for the file WarAndPeace.txt<br />

(available on the booksite) with this client and discuss the results.<br />

3.5.32 Dictionary. Study the performance of a client like LookupCSV in a scenario<br />

where performance matters. Specifically, design a query-generation scenario instead of<br />

taking commands from standard input, and run performance tests for large inputs and<br />

large numbers of queries.<br />

3.5.33 Indexing. Study a client like LookupIndex in a scenario where performance<br />

matters. Specifically, design a query-generation scenario instead of taking commands<br />

from standard input, and run performance tests for large inputs and large numbers of<br />

queries.<br />

3.5.34 Sparse vector. Run experiments to compare the performance of matrix-vector<br />

multiplication using SparseVector to the standard implementation using arrays.<br />

3.5.35 Primitive types. Evaluate the utility of using primitive types for Integer and<br />

Double values, for LinearProbingHashST and RedBlackBST. How much space and<br />

time are saved, for large numbers of searches in large tables?

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!