Mastering Algorithms with Perl phần 10 pot

73 188 0
Mastering Algorithms with Perl phần 10 pot

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

crack program, 529 cracking (guessing) passwords, 529-532 cross edges, 317 cross product, 435 cryptography, 526-565 authorizing data, 533-537 authorizing passwords, 528-533 encrypted source code, 562-564 encryption, 538-555 legal issues 527 security issues in general, 564 steganography, 555-558 winnowing and chaffing, 558-562 crypt( ) function, 529 cubic( ), 268, 637 cubic equations, finding roots, 636 cubic splines, 644-647 customizing algorithms, 5 data structures, 26 cycles, 301 Euler and Hamiltonian cycles, 311 in graphs, 277 negative cycles, 334, 337 D DAGs (directed acyclic graphs), 304, 312 single-source shortest paths, 338 data access methods, 526 authentication and integrity, 533-537 discarding invalid (winnowing), 558 hiding (steganography), 555-558 passwords, authorizing, 528-533 smoothing, 648 data encryption (see encryption) Data Encryption Standard (see DES) data link escape (DLE) character, 414 data structures, 22, 24-101 arrays/lists (see arrays) binary trees, 314 preorder, postorder, inorder, 314 searching, 167-171 constructed, 34 garbage collection (see garbage collection) hashes (see hashes) heaps, 91-101 binary heaps, 92-99 Heap modules, 99 Janus heaps, 99 linked lists, 47-59 circular, 60-62 doubly-linked lists, 65-71 tracking both ends, 52-55 lookup searching and, 159, 173 matrices (see matrices) sets (see sets) traversal performance, 72 union-tree forests, 326 within arrays, 37-45 dataflow analysis, 396 Date: :Calc module, 489 Date: :Convert module, 490 Date: :GetDate module, 490 Date: :Manip module, 489 dates and times, 489 datetab( ), 168 daVinci package, 301 DB_File module, 170 DBL_EPSILON constant, 473 dealing cards, 589break Page 663 debugging heaps, 101 silencing warnings, 135 decile( ), 142 decimal numbers, 481 decimal point, rounding to, 474 declaring scalars, 4 decryption (see encryption) decrypt.xs file, 562-563 definite integrals, computing, 631-634 degree( ), 297 degree of graph vertices, 279-281, 296 delete_edge( ), 297 delete_edges( ), 297 delete operator, 205 delete_vertex( ), 297 deleting binary tree elements, 77, 80-81, 84 graph edges and vertices, 297-299 linked list elements, 55, 60 set members (subtracting), 205, 218 delimiters, balancing, 410 dense sets, 229 density, graph, 285, 296 density_limits( ), 296 dependency graphs, 304 dependent events, 569 dependent variables, 620 depth-first search, 193, 301-304 graph traversal, 309, 314 deques, 40-42 circular linked lists vs., 60 dereferencing, 5 deriv( ), 628, 638 derivatives, computing, 628-629 Jacobian matrix, 629-631 derived graphs, 281-285 complement graph, 284 complete graph, 282 graph transpose, 282 DES (Data Encryption Standard), 528, 543 Perl implementation (SSLeay), 543 DES-EDE and DES-EDE3 encryption algorithms, 543 descendant vertices, 315 destroy( ) (double package), 66, 68 DESTROY( ), 65, 68, 70 det_LR( ), 262 determinant, matrix, 262 deterministic finite automata (DFA), 354, 396 DFA: :Kleene module, 231 DFS (depth-first search), 301-304 graph traversal, 309, 314 dictionary order, 107 die_roll( ), 577 difference( ), 220 difference levels (Wu-Manber), 382 differences and fuzzy matching, 379 differences, sets, 217-222 differential analysis, 543 Diffie, Whitfield, 548 digital images, secret messages in, 555 digital signatures, 537 El Gamal public key encryption, 552 Dijkstra's single-source shortest paths, 334-337 dimensions (see size) directed acyclic graphs (DAGs), 304, 312 single-source shortest paths, 338 directed graphs and edges, 277-279, 291-293 directed( ), 292 direction, specifying, 433-435 directional alternative hypotheses, 612 directories, searching with B-trees, 169 discrete probability distributions, 575 algorithms for (list), 592-598 expected value, 575 disjointed sets, 223 disk space, 9-11 caching, 16 lookup tables, 9 display( ) (position), 177 display_poker( ), 587 display_poker_many( ), 587 distance( ), 427 distance, calculating, 426-429 distributions (see probability distributions) divergent series, 494 divide-and-conquer strategy, 21, 134 closest pair of points, 457 division modular, 513 numeric precision and, 574 divisors, 499 greatest common (see GCD) DLE character, 414break Page 664 Dominus, Mark-Jason, 71, 113, 171, 386, 416, 505 double package (example), 65 double-ended queues (deques), 40-42 circular linked lists vs., 60 double_head package, 68 doubly-linked lists, 65-71 downloading files, risks, 534 dynamic programming, 22, 202 matrix chain products, 269 dynamic variables, 36 E eavesdropping, 529 ECB (Electronic Code Book), 543 edge_classify( ), 318 edges, graph, 276-281 adding and testing for, 291-293 attributes, 299 classes, 279-281, 316-320 deleting, 297-299 direction, 277-279 graph density, 285, 296 walking (see traversing graphs) weight/cost, 286, 334 (see also graphs) editing algorithms, 5 Edmonds-Karp algorithm, 348 Edmonds-Karp flow network, 307 efficiency of algorithms, 8-20 arrays and hashes, 27-29, 33, 43 Benchmark module, 11 caching, 16 dynamic allocation, 37 floating-point numbers, 14 heaps, 92 linked lists, 47 tail pointers, 54 list traversal performance, 72 O (N) notation, 17-20 recursion, 21 regular expressions, 355 searching, 157 lookup searches, 172-175 sets, 243 membership sets, 216 power set generation, 239 sorting, 108-116, 145-150 bubble sort, 126 external sorting, 150 insertion sort, 129 sensitivity and stability, 119 shellsort, 132 summary and comparison, 151-156 string matching naïve searching, 361 Rabin-Karp algorithm, 369 tips for regular expressions, 355 temporary variables, 14 eigen_c( ), 266 eigenvalue( ), 268 eigenvalues and eigenvectors, 266-269 direct eigenvalue calculation, 268 El Gamal public key encryption, 552-554 Electronic Code Book (ECB), 543 elements of matrices, 246 elements of sets (see members of sets) emit( ), 402-403 empty set, 213 encryption, 526, 538-554 algorithms (licensing), 527 authentication vs., 559 block unit size, 547 lost/stolen keys, 564 meet-in-the-middle attacks, 543 one-time pads, 538-540, 543 password storage, 528 of Perl source code, 562-564 product development (government restrictions), 527 public key, 533, 543, 548-554 El Gamal, 552-554 private key vs., 554 RSA, 549-552 random numbers, 568 shared-secret, 540-548 Caesar cipher, 540 differential analysis algorithm, 543 idea-ecb algorithm, 543 Solitaire algorithm, 542 SSLeay module for, 543-548 steganography vs., 555 winnowing and chaffing, 558-562 (see also cryptography) encryption object, creating, 546 English stemming (see stemming) epsilon, 472 eq statement, 359break Page 665 equations, solving, 634-642 approximating roots, 638-640 multiple nonlinear equations, 640-642 quadratics and cubics, 635-638 Eratosthenes, sieve of, 504 erlang( ), 595 Erlang distribution, 595 erlang_expected( ), 595 erlang_variance( ), 595 error( ), 400, 404 estimate_variance( ), 614, 618 Euclidean distance, 426 euclid( ), 501 Euler cycles, 311 Euler path, 311 Euler tours, 311 Euler's formula, 485 evaluate( ) (position), 177 events, probability of, 566, 569-571 birthday conundrum, 570 distributions (see probability distributions) multiple events, 569-571, 581 exact matching, 354 shift-OR exact matching, 377-379 exclusive binary or (XOR) operator, 220-221 exclusive logical or (xor) operator, 210 exclusive-or (XOR), 538, 540 exhaustive search, 180-185 [...]... bridges, 310- 312, 320 representing in computers, 287-301 strongly connected components, 282 traversing, 275, 301- 310 breadth-first search, 301, 307, 310 depth-first search, 301-304, 309, 314 implementation, 307- 310 topological sort, 304-307, 309 vertices (see vertices, graph) graphviz package, 301 great circle distance, 429 great_circle_distance( ), 429 greatest common divisor (see GCD) greedy search algorithms, ... (&&) operator, 240 logical exclusive or (xor) operator, 210 logical not (!) operator, 240 logical or ( | | ) operator, 210, 240 lognormal( ), 597 lognormal_expected( ), 597 lognormal_variance( ), 597 lohs (list of hashes), 29 lols (lists of lists), 29, 34 searching, 168 longest common subsequence (LCS), 386 lookup_array( ), 10 lookup_hash( ), 10 lookup searches, 158-175 binary search in list, 162-165... nondeterministic events, 568 nondeterministic finite automata (NFA), 396 nondirectional alternative hypotheses, 612 none_of( ), 569 none, probability of, 569-570 nongame dynamic searches, 193-202 A* algorithm, 200-202 branch and bound method, 196-200 greedy algorithms, 195 noninfinite arithmetic, 510 nonrecursive vs recursive algorithms, 21 nonterminals (BNF), 397 nonuniform discrete distributions, 582-589 nonvalid... (cryptography), 527, 543, 559 expression( ), 400-401, 403 exterior vertices, 320 external searches, 174 external sorting, 150 extract( ), 98, 556 extract_bracketed( ), 410 extract_codeblock( ), 410 extract_multiple( ), 411 extract_quotelike( ), 410 extract_tagged( ), 411 extract_variable( ), 411 extracting submatrices, 259 extrapolation, 642-648 F F-ratio, 617-620 factor( ), 399-401 factorial( ), 478, 572... sorting, 117-118 token recognition, 408 hashing algorithm, 362 Hayward, Gwilym, 161 heap( ), 101 Heap: :Binary module, 99 Heap: :Binomial module, 99 Heap: :Fibonacci module, 99 heapdown( ), 95-99 heapdump( ) (Heap modules), 101 heapify( ), 97, 136 heapify_array_down( ), 96-97 heapify_array_up( ), 96 heaps, 91 -101 binary heaps, 92-99 branch and bound method, 196 caching prime numbers, 505 efficiency of,... fields for sorting (see keys, sorting) fieldsort( ), 106 FIFO order, 38 file_crypt( ), 547 files B-trees to search for, 169 content changes, detecting, 526 downloading, security risks, 534 encrypting/decrypting entire, 547 mailing (security risks), 527 Filter module, 562 filtering Perl source code, 562 finding (see searching) finite arithmetic, 510 finite automata, 395-396 deterministic vs nondeterministic,... generality of algorithms, 6-8 generalized Chinese remainder theorem, 511 generalized least square methods, 648 generative searching, 158, 175-202 exhaustive search, 180-185 game interface for, 176-180 killer move strategy, 189, 202 minimax search, 185-187, 193 opening book strategy, 192 pruning, 187-189, 192 symmetry, 192 transpose tables, 190-191 pruning with, 192 geometric( ), 596 geometric algorithms, ... 511, 513, 519break Page 673 (cont'd) numbers, number theory noninfinite arithmetic, 510 unsolved number problems, 522-525 numeric order, 105 numerical analysis, 626-648 derivatives and integrals, 627-634 interpolation, extrapolation, curve fitting, 642-648 solving equations, 634-642 prime numbers, 504-522 caching, 505- 510 El Gamal key, generating, 552 factoring, 549 Goldbach conjecture, 524 Miller-Rabin... characters (encrypted scripts), 563 mailmessage( ), 560 make_fieldsort( ) (Sort: :Fields), 106 make_move( ) (position), 177 make utility, 306 Mandelbrot set, 486 Manfredi, Raphael, 491 manhattan_distance( ), 427 Manhattan distance, 427 manhattan_intersection( ), 441 Manhattan intersections, 435, 440-443 map( ), 109 Marquess, Paul, 117, 170, 423, 562 match heuristic, 373 matching strings (see regular... iterative vs recursive algorithms, 21 J jacobian( ), 630, 640 Jacobian matrix, 629-631, 640 Janus heaps, 99 joining binary trees, 85-86 junk messages, adding (chaffing), 558 K k-connected graphs, 286, 320 keys, encryption, 540, 542 converting from hex to bytes, 548 interchanging public and private, 552 lost or stolen, 564 keys, hashes, 26 emulating sets, 205, 213 keys, sorting, 102 killer move strategy, . 292 direction, specifying, 433-435 directional alternative hypotheses, 612 directories, searching with B-trees, 169 discrete probability distributions, 575 algorithms for (list), 592-598 expected value, 575 disjointed. 174 external sorting, 150 extract( ), 98, 556 extract_bracketed( ), 410 extract_codeblock( ), 410 extract_multiple( ), 411 extract_quotelike( ), 410 extract_tagged( ), 411 extract_variable( ), 411 extracting. 275, 281 paths and bridges, 310- 312, 320 representing in computers, 287-301 strongly connected components, 282 traversing, 275, 301- 310 breadth-first search, 301, 307, 310 depth-first search, 301-304,

Ngày đăng: 12/08/2014, 21:20

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan