310 at a relatively simple algorithm that solves this problem much |
310 at a relatively simple algorithm that solves this problem much |
311 better than Python and Ruby do\ldots actually it will be two |
311 better than Python and Ruby do\ldots actually it will be two |
312 versions of the algorithm: the first one will be able to |
312 versions of the algorithm: the first one will be able to |
313 process strings of approximately 1,000 \texttt{a}s in 30 |
313 process strings of approximately 1,000 \texttt{a}s in 30 |
314 seconds, while the second version will even be able to process |
314 seconds, while the second version will even be able to process |
315 up to 12,000 in less than 10(!) seconds, see the graph below: |
315 up to 7,000(!) in 30 seconds, see the graph below: |
316 |
316 |
317 \begin{center} |
317 \begin{center} |
318 \begin{tikzpicture} |
318 \begin{tikzpicture} |
319 \begin{axis}[ |
319 \begin{axis}[ |
320 title={Graph: $\texttt{a?\{n\}\,a{\{n\}}}$ and strings |
320 title={Graph: $\texttt{a?\{n\}\,a{\{n\}}}$ and strings |
321 $\underbrace{\texttt{a}\ldots \texttt{a}}_{n}$}, |
321 $\underbrace{\texttt{a}\ldots \texttt{a}}_{n}$}, |
322 xlabel={$n$}, |
322 xlabel={$n$}, |
323 x label style={at={(1.05,0.0)}}, |
323 x label style={at={(1.05,0.0)}}, |
324 ylabel={time in secs}, |
324 ylabel={time in secs}, |
325 enlargelimits=false, |
325 enlargelimits=false, |
326 xtick={0,3000,...,12000}, |
326 xtick={0,3000,...,9000}, |
327 xmax=13000, |
327 xmax=10000, |
328 ymax=12, |
328 ymax=32, |
329 ytick={0,5,10}, |
329 ytick={0,5,...,30}, |
330 scaled ticks=false, |
330 scaled ticks=false, |
331 axis lines=left, |
331 axis lines=left, |
332 width=7cm, |
332 width=7cm, |
333 height=4.5cm, |
333 height=4.5cm, |
334 legend entries={Our Algorithm V1, Our Algorithm V2}, |
334 legend entries={Our Algorithm V1, Our Algorithm V2}, |
350 $\underbrace{\texttt{a}\ldots \texttt{a}}_{n}$}, |
350 $\underbrace{\texttt{a}\ldots \texttt{a}}_{n}$}, |
351 xlabel={$n$}, |
351 xlabel={$n$}, |
352 x label style={at={(1.05,0.0)}}, |
352 x label style={at={(1.05,0.0)}}, |
353 ylabel={time in secs}, |
353 ylabel={time in secs}, |
354 enlargelimits=false, |
354 enlargelimits=false, |
355 ymax=12, |
355 ymax=32, |
356 ytick={0,5,10}, |
356 ytick={0,5,...,30}, |
357 axis lines=left, |
357 axis lines=left, |
358 width=7cm, |
358 width=7cm, |
359 height=4.5cm, |
359 height=4.5cm, |
360 legend entries={Our Algorithm V2}, |
360 legend entries={Our Algorithm V2}, |
361 legend pos=outer north east] |
361 legend pos=outer north east] |