The.Algorithm.Design.Manual.Springer-Verlag.1998
The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998
Implementation Challenges Next: Breaking Problems Down Up: Data Structures and Sorting Previous: Exercises Implementation Challenges 1. Implement versions of several different dictionary data structures, such as linked lists, binary trees, balanced binary search trees, and hash tables. Conduct experiments to assess the relative performance of these data structures in a simple application that reads a large text file and reports exactly one instance of each word that appears within it. This application can be efficiently implemented by maintaining a dictionary of all distinct words that have appeared thus far in the text and inserting/reporting each word that is not found. Write a brief report with your conclusions. 2. Implement versions of several different sorting algorithms, such as selection sort, insertion sort, heapsort, mergesort, and quicksort. Conduct experiments to assess the relative performance of these algorithms in a simple application that reads a large text file and reports exactly one instance of each word that appears within it. This application can be efficiently implemented by sorting all the words that occur in the text and then passing through the sorted sequence to identify one instance of each distinct word. Write a brief report with your conclusions. Algorithms Mon Jun 2 23:33:50 EDT 1997 file:///E|/BOOK/BOOK/NODE41.HTM [19/1/2003 1:37:08]
Implementation Challenges Next: Graph Algorithms Up: Breaking Problems Down Previous: Exercises Implementation Challenges 1. (*) Many types of products sold appeal more to members of one ethnic group than another. Perhaps Greeks eat more pasta per capita than Russians do, while Japanese find baseball more appealing than do Italians. A market researcher might be interested in having a program scan the names on a mailing list to select the ones most likely to be, say, Greek to target for a given mailing. Develop a program that makes reasonable mappings between pairs of first/ last names and ethnicities. One approach would be to compute the edit distance between query names and a family of names of known ethnicity. Feel free to experiment with other approaches. 2. (*) In the game of Battleship, the first player hides a collection of, say, three ships on a grid. The second player guesses a series of grid positions and is informed whether they hit or miss a battleship. The second player continues to query until each of the battleship positions has been probed. While the second player must succeed after making 100 different probes, we seek a strategy to use as few probes as possible to achieve the goal. Develop a program that tries to efficiently sink all the battleships. One reasonable algorithmic approach would be based on divide-and-conquer or binary search. 3. (*) A Caesar shift (see Section ) is a very simple class of ciphers for secret messages. Unfortunately, they can be broken using statistical properties of English. Develop a program capable of decrypting Caesar shifts of sufficiently long texts. Algorithms Mon Jun 2 23:33:50 EDT 1997 file:///E|/BOOK/BOOK2/NODE58.HTM [19/1/2003 1:37:09]
- Page 1137 and 1138: Genocop -- Optimization via Genetic
- Page 1139 and 1140: 1.2.6 Linear Programming ● Knapsa
- Page 1141 and 1142: 1.2.7 Random Number Generation ●
- Page 1143 and 1144: 1.3.10 Satisfiability ● Constrain
- Page 1145 and 1146: Qhull - higher dimensional convex h
- Page 1147 and 1148: 1.6.5 Nearest Neighbor Search 1.6.5
- Page 1149 and 1150: 1.6.7 Point Location 1.6.7 Point Lo
- Page 1151 and 1152: 1.6.10 Medial-Axis Transformation 1
- Page 1153 and 1154: 1.6.3 Triangulation 1.6.3 Triangula
- Page 1155 and 1156: Nijenhuis and Wilf: Combinatorial A
- Page 1157 and 1158: 1.5.5 Hamiltonian Cycle 1.5.5 Hamil
- Page 1159 and 1160: 1.4.6 Matching 1.4.6 Matching INPUT
- Page 1161 and 1162: A compendium of NP optimization pro
- Page 1163 and 1164: 1.6.9 Bin Packing 1.6.9 Bin Packing
- Page 1165 and 1166: 1.6.12 Simplifying Polygons 1.6.12
- Page 1167 and 1168: 1.6.13 Shape Similarity 1.6.13 Shap
- Page 1169 and 1170: 1.6.11 Polygon Partitioning 1.6.11
- Page 1171 and 1172: 1.4.3 Minimum Spanning Tree 1.4.3 M
- Page 1173 and 1174: 1.6.15 Maintaining Line Arrangement
- Page 1175 and 1176: 1.3.7 Generating Graphs 1.3.7 Gener
- Page 1177 and 1178: 1.2.11 Discrete Fourier Transform 1
- Page 1179 and 1180: 1.5.8 Edge Coloring 1.5.8 Edge Colo
- Page 1181 and 1182: 1.3.3 Median and Selection 1.3.3 Me
- Page 1183 and 1184: 1.3.1 Sorting 1.3.1 Sorting INPUT O
- Page 1185 and 1186: Plugins for use with the CDROM Plug
- Page 1187: Implementation Challenges Next: Dat
- Page 1191 and 1192: Implementation Challenges Next: Int
- Page 1193 and 1194: Caveats Next: Data Structures Up: A
- Page 1195 and 1196: 1.1.1 Dictionaries ● Priority Que
- Page 1197 and 1198: 1.1.4 Graph Data Structures ● Gra
- Page 1199 and 1200: 1.1.5 Set Data Structures ● Gener
- Page 1201 and 1202: 1.2.1 Solving Linear Equations ●
- Page 1203 and 1204: 1.2.2 Bandwidth Reduction ● Topol
- Page 1205 and 1206: 1.2.4 Determinants and Permanents
- Page 1207 and 1208: 1.2.8 Factoring and Primality Testi
- Page 1209 and 1210: 1.2.9 Arbitrary Precision Arithmeti
- Page 1211 and 1212: 1.2.10 Knapsack Problem ● Linear
- Page 1213 and 1214: 1.3.2 Searching ● Sorting Go to t
- Page 1215 and 1216: 1.3.4 Generating Permutations ● C
- Page 1217 and 1218: 1.3.5 Generating Subsets ● Genera
- Page 1219 and 1220: 1.3.6 Generating Partitions ● Gen
- Page 1221 and 1222: 1.3.8 Calendrical Calculations Go t
- Page 1223 and 1224: 1.3.9 Job Scheduling ● Feedback E
- Page 1225 and 1226: 1.4.2 Topological Sorting Related P
- Page 1227 and 1228: 1.4.8 Edge and Vertex Connectivity
- Page 1229 and 1230: 1.4.10 Drawing Graphs Nicely ● Pl
- Page 1231 and 1232: 1.4.11 Drawing Trees ● Planarity
- Page 1233 and 1234: 1.4.12 Planarity Detection and Embe
- Page 1235 and 1236: 1.5.2 Independent Set ● Vertex Co
- Page 1237 and 1238: 1.5.3 Vertex Cover ● Independent
Implementation Challenges<br />
Next: Breaking Problems Down Up: Data Structures and Sorting Previous: Exercises<br />
Implementation Challenges<br />
1. Implement versions of several different dictionary data structures, such as linked lists, binary<br />
trees, balanced binary search trees, and hash tables. Conduct experiments to assess the relative<br />
performance of these data structures in a simple application that reads a large text file and reports<br />
exactly one instance of each word that appears within it. This application can be efficiently<br />
implemented by maintaining a dictionary of all distinct words that have appeared thus far in the<br />
text and inserting/reporting each word that is not found. Write a brief report with your<br />
conclusions.<br />
2. Implement versions of several different sorting algorithms, such as selection sort, insertion sort,<br />
heapsort, mergesort, and quicksort. Conduct experiments to assess the relative performance of<br />
these algorithms in a simple application that reads a large text file and reports exactly one instance<br />
of each word that appears within it. This application can be efficiently implemented by sorting all<br />
the words that occur in the text and then passing through the sorted sequence to identify one<br />
instance of each distinct word. Write a brief report with your conclusions.<br />
<strong>Algorithm</strong>s<br />
Mon Jun 2 23:33:50 EDT 1997<br />
file:///E|/BOOK/BOOK/NODE41.HTM [19/1/2003 1:37:08]