cs3110 / textbook

The CS 3110 Textbook, "OCaml Programming: Correct + Efficient + Beautiful"
Other
720 stars 132 forks source link

Table on big-oh notation not displayed correctly #174

Closed cionx closed 4 months ago

cionx commented 7 months ago

The appendix on big-oh notation features the following table:

https://github.com/cs3110/textbook/blob/781cf6c354fd4cd5ffb484be09974ed01aea4072/src/chapters/appendix/bigoh.md?plain=1#L148-L155

This table isn’t displayed correctly. The current output looks as follows:

table

The following code should hopefully render correctly:

 |           |  $N$  |  $N^2$  |  $N^3$  |  $2^N$   |
 |:----------|:-----:|:-------:|:-------:|:--------:| 
 |N=10       |< 1 sec|< 1 sec  |< 1 sec  | < 1 sec  |
 |N=100      |< 1 sec|< 1 sec  |  1 sec  |1017 years|
 |N=1,000    |< 1 sec|  1 sec  | 18 min  | very long|
 |N=10,000   |< 1 sec|  2 min  | 12 days | very long|
 |N=100,000  |< 1 sec|  3 hours| 32 years| very long|
 |N=1,000,000|  1 sec| 12 days |104 years| very long|

At least here on GitHub, this code renders as follows:

$N$ $N^2$ $N^3$ $2^N$
N=10 < 1 sec < 1 sec < 1 sec < 1 sec
N=100 < 1 sec < 1 sec 1 sec 1017 years
N=1,000 < 1 sec 1 sec 18 min very long
N=10,000 < 1 sec 2 min 12 days very long
N=100,000 < 1 sec 3 hours 32 years very long
N=1,000,000 1 sec 12 days 104 years very long

(I’d personally also right-align all columns but the first, but that’s probably a matter of taste.)

clarksmr commented 4 months ago

Thanks!