Make tables valid markdown
This commit is contained in:
parent
18f5ace919
commit
2091516544
13 changed files with 156 additions and 1002 deletions
138
10-02.md
138
10-02.md
|
|
@ -42,130 +42,18 @@ poor when iS is large.
|
|||
\
|
||||
**Figure 10.1** *Using a brute-force algorithm to find a GCD.*
|
||||
|
||||
* * * * *
|
||||
**Integer pairs for which to find GCD**
|
||||
|
||||
Integer pairs for which to find GCD
|
||||
| | 90 & 27 | 42 & 998 | 453 & 121 | 27432 & 165 | 27432 & 17550 |
|
||||
|----------------------------------------------------------------------------------------|-------------|--------------|--------------|--------------|----------------|
|
||||
| **Listing 10.1** (Brute force) | 60µs (100%) | 110µs (100%) | 311ms (100%) | 426µs (100%) | 43580µs (100%) |
|
||||
| **Listing 10.2** (Subtraction) | 25 (42%) | 72 (65%) | 67 (22%) | 280 (66%) | 72 (0.16%) |
|
||||
| **Listing 10.3** (Division: code recursive Euclid's algorithm) | 20 (33%) | 33 (30%) | 48 (15%) | 32 (8%) | 53 (0.12%) |
|
||||
| **Listing 10.4** (C version of data recursive Euclid's algorithm; normal optimization) | 12 (20%) | 17 (15%) | 25 (8%) | 16 (4%) | 26 (0.06%) |
|
||||
| **Listing 10.4** (/Ox = maximumoptimization) | 12 (20%) | 16 (15%) | 20 (6%) | 15 (4%) | 23 (0.05%) |
|
||||
| **Listing 10.5** (Assembly version of data recursive Euclid's algorithm) | 10 (17%) | 10 (9%) | 15 (5%) | 10 (2%) | 17 (0.04%) |
|
||||
|
||||
90 & 27
|
||||
|
||||
42 & 998
|
||||
|
||||
453 & 121
|
||||
|
||||
27432 & 165
|
||||
|
||||
27432 & 17550
|
||||
|
||||
* * * * *
|
||||
|
||||
**Listing 10.1**\
|
||||
(Brute force)
|
||||
|
||||
60µs\
|
||||
(100%)
|
||||
|
||||
110µs\
|
||||
(100%)
|
||||
|
||||
311ms\
|
||||
(100%)
|
||||
|
||||
426µs\
|
||||
(100%)
|
||||
|
||||
43580µs\
|
||||
(100%)
|
||||
|
||||
**Listing 10.2**\
|
||||
(Subtraction)
|
||||
|
||||
25\
|
||||
(42%)
|
||||
|
||||
72\
|
||||
(65%)
|
||||
|
||||
67\
|
||||
(22%)
|
||||
|
||||
280\
|
||||
(66%)
|
||||
|
||||
72\
|
||||
(0.16%)
|
||||
|
||||
**Listing 10.3**\
|
||||
(Division: code recursive\
|
||||
Euclid's algorithm)
|
||||
|
||||
20\
|
||||
(33%)
|
||||
|
||||
33\
|
||||
(30%)
|
||||
|
||||
48\
|
||||
(15%)
|
||||
|
||||
32\
|
||||
(8%)
|
||||
|
||||
53\
|
||||
(0.12%)
|
||||
|
||||
**Listing 10.4**\
|
||||
(C version of data recursive Euclid's algorithm; normal optimization)
|
||||
|
||||
12\
|
||||
(20%)
|
||||
|
||||
17\
|
||||
(15%)
|
||||
|
||||
25\
|
||||
(8%)
|
||||
|
||||
16\
|
||||
(4%)
|
||||
|
||||
26\
|
||||
(0.06%)
|
||||
|
||||
**Listing 10.4**\
|
||||
(/Ox = maximumoptimization)
|
||||
|
||||
12\
|
||||
(20%)
|
||||
|
||||
16\
|
||||
(15)
|
||||
|
||||
20\
|
||||
(6%)
|
||||
|
||||
15\
|
||||
(4%)
|
||||
|
||||
23\
|
||||
(0.05%)
|
||||
|
||||
**Listing 10.5**\
|
||||
(Assembly version of data recursive Euclid's algorithm)
|
||||
|
||||
10\
|
||||
(17%)
|
||||
|
||||
10\
|
||||
(9%)
|
||||
|
||||
15\
|
||||
(5%)
|
||||
|
||||
10\
|
||||
(2%)
|
||||
|
||||
17\
|
||||
(0.04%)
|
||||
Table: Table 10.1 Performance of GCD algorithm implementations.
|
||||
|
||||
**Note:** Performance of Listings 10.1 through 10.5 in finding the
|
||||
greatest common divisors of various pairs of integers. Times are in
|
||||
|
|
@ -175,12 +63,6 @@ the execution time of Listing 10.1 for the same integer pair. Listings
|
|||
default optimization was used. All times measured with the Zen timer
|
||||
(from Chapter 3) on a 20 MHz cached 386.
|
||||
|
||||
* * * * *
|
||||
|
||||
Table 10.1 Performance of GCD algorithm implementations.
|
||||
|
||||
* * * * *
|
||||
|
||||
**LISTING 10.1 L10-1.C**
|
||||
|
||||
/* Finds and returns the greatest common divisor of two positive
|
||||
|
|
|
|||
Loading…
Reference in a new issue