-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchap3_3understandAlgorithm.html
745 lines (626 loc) · 23.4 KB
/
chap3_3understandAlgorithm.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>4.3. Think, write and test algorithms — Computing for engineer 1.0 documentation</title>
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="5. C/C++ Programming Langage" href="chap4_cLangage_Chap.html" />
<link rel="prev" title="4.2. Algorithm Syntax" href="chap3_2algorithmSyntax.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> Computing for engineer
</a>
<div class="version">
1.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="Introduction.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="chap1_binaryLogic_Chap.html">2. Binary logic</a></li>
<li class="toctree-l1"><a class="reference internal" href="chap2_architecture_Chap.html">3. Computer architecture</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="chap3_algorithm_Chap.html">4. Algorithm</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="chap3_1concept.html">4.1. Basic concept of algorithm</a></li>
<li class="toctree-l2"><a class="reference internal" href="chap3_2algorithmSyntax.html">4.2. Algorithm Syntax</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">4.3. Think, write and test algorithms</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#thinking-and-writting-algorithm">4.3.1. Thinking and writting algorithm</a></li>
<li class="toctree-l3"><a class="reference internal" href="#testing-trace-table">4.3.2. Testing: trace table</a></li>
<li class="toctree-l3"><a class="reference internal" href="#basic-exercices">4.3.3. Basic exercices</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#permutation">4.3.3.1. Permutation</a></li>
<li class="toctree-l4"><a class="reference internal" href="#accumulation">4.3.3.2. Accumulation</a></li>
<li class="toctree-l4"><a class="reference internal" href="#if-conditional-instructions">4.3.3.3. if conditional instructions</a></li>
<li class="toctree-l4"><a class="reference internal" href="#while-repetitive-instructions">4.3.3.4. While repetitive instructions</a></li>
<li class="toctree-l4"><a class="reference internal" href="#for-repetitive-instruction">4.3.3.5. For repetitive instruction</a></li>
<li class="toctree-l4"><a class="reference internal" href="#using-and-writting-functions">4.3.3.6. Using and writting functions</a></li>
<li class="toctree-l4"><a class="reference internal" href="#playing-with-arrays">4.3.3.7. Playing with arrays</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="chap4_cLangage_Chap.html">5. C/C++ Programming Langage</a></li>
<li class="toctree-l1"><a class="reference internal" href="chap5_arduino_Chap.html">6. Arduino</a></li>
<li class="toctree-l1"><a class="reference internal" href="chap6_python_Chap.html">7. Python</a></li>
<li class="toctree-l1"><a class="reference internal" href="chap7_C++_Chap.html">8. C++</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Computing for engineer</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li><a href="chap3_algorithm_Chap.html">4. Algorithm</a> »</li>
<li>4.3. Think, write and test algorithms</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/chap3_3understandAlgorithm.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="think-write-and-test-algorithms">
<h1>4.3. Think, write and test algorithms<a class="headerlink" href="#think-write-and-test-algorithms" title="Permalink to this headline">¶</a></h1>
<p>Writting an algorithm to solve a problem acts in several steps. From a clear statement, the analyst should:</p>
<ol class="arabic simple">
<li>Extract and formalize input data</li>
<li>Determine what will be the result</li>
<li>Elaborate the process that will produce the result from input data</li>
</ol>
<div class="section" id="thinking-and-writting-algorithm">
<h2>4.3.1. Thinking and writting algorithm<a class="headerlink" href="#thinking-and-writting-algorithm" title="Permalink to this headline">¶</a></h2>
<p>In the major cases, the analyst is not producing the “good” algorithm the first time. It is common to produce several versions of an algorithm until it reaches the objectives. One can retain some general method to write an algorithm:</p>
<ul class="simple">
<li>Read and understand the statement.</li>
<li>Imagine the discussion between the user and the processor: what should the user give to the processor and what does it return in exchange.</li>
<li>Solve the problem by hand on typical example to verify the understanding and begin to structure what kind of instructions will be necessary.</li>
<li>Isolate the problem data and make a first version of variable declarations.</li>
<li>Organise ideas to find complex successive instructions that can solve the problem. Take care about conditions and repetitive instructions that can emerge from any reformulation of the statement.</li>
<li>Treat independantly each complex instruction in elementary instructions that will represent instruction blocks of the written algorithm. This step may require to add new variables to the declaration section of the algorithm. If some operations seems very complex, do not hesitate to structure the algorithm using functions.</li>
</ul>
</div>
<div class="section" id="testing-trace-table">
<h2>4.3.2. Testing: trace table<a class="headerlink" href="#testing-trace-table" title="Permalink to this headline">¶</a></h2>
<p>When a version of an algorithm has been written, it should be tested and eventually corrected. This is a complex step in algorithm writting because the more the tests will be exhaustive, the more the validation of the safety of the produced algorithm will be. For example, if one of the input of the algorithm is an integer, one can test positive, nul and negative values for this integer.</p>
<p>There are at least two possibilities to test an algorithm:</p>
<ul class="simple">
<li>Traduce it in a programming language and run it on a computer on different data sets.</li>
<li>Test by hand using a trace table</li>
</ul>
<p>A <strong>trace table</strong> is representing the value of variables (and eventually the screen output) at each line during the algorithm execution.</p>
<p>Let us take the example of the conversion algorithm seen in section <a class="reference internal" href="chap3_2algorithmSyntax.html#sec-chap3-firstexample"><span class="std std-ref">A first example</span></a>. This algorithm is recalled hereafter:</p>
<div class="highlight-none notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16</pre></div></td><td class="code"><div class="highlight"><pre><span></span>Algorithm convertTemperatureCtoK
--------------------------------
Description
Print temperature in Kelvin from input read temperature in Celcius
--------------------------------
Constants
zeroC = 273.15
Variables
tempC : real
tempK : real
Start
Print("Enter temperature in Celcius :")
Read(tempC)
tempK <- tempC + zeroC
Print(tempC, "°C is ", tempK, "K")
End
</pre></div>
</td></tr></table></div>
<p>A possible trace table for this algorithm is:</p>
<table border="1" class="docutils">
<colgroup>
<col width="10%" />
<col width="13%" />
<col width="12%" />
<col width="12%" />
<col width="53%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">line</th>
<th class="head">zeroC</th>
<th class="head">tempC</th>
<th class="head">tempK</th>
<th class="head">screen</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>7</td>
<td>273.15</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr class="row-odd"><td>12</td>
<td> </td>
<td> </td>
<td> </td>
<td>Enter temperature un Celcius :</td>
</tr>
<tr class="row-even"><td>13</td>
<td> </td>
<td>42.0</td>
<td> </td>
<td> </td>
</tr>
<tr class="row-odd"><td>14</td>
<td> </td>
<td> </td>
<td>315.15</td>
<td> </td>
</tr>
<tr class="row-even"><td>15</td>
<td> </td>
<td> </td>
<td> </td>
<td>42.0°C is 315.15K</td>
</tr>
</tbody>
</table>
<p>Testing this algorithm with a temperature of -300 °C will send an unphysical result and shows one of the algorithm limitations.</p>
</div>
<div class="section" id="basic-exercices">
<span id="sec-chap3-basics"></span><h2>4.3.3. Basic exercices<a class="headerlink" href="#basic-exercices" title="Permalink to this headline">¶</a></h2>
<p>Here are presented some basic exercices that needs to be understand before writting more complex algorithms. This section is a practicing section that should be done sequentially to understand the basic instructions to build algorithms.</p>
<div class="section" id="permutation">
<span id="sec-chap3-permutation"></span><h3>4.3.3.1. Permutation<a class="headerlink" href="#permutation" title="Permalink to this headline">¶</a></h3>
<p>The aim is to permut the content of two variables. This kind of instruction may be used when sorting data in arrays for example. Consider the following algorithm:</p>
<div class="highlight-none notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17</pre></div></td><td class="code"><div class="highlight"><pre><span></span>Algorithm permutation_V0
------------------------
Description
Permuts the content of variables var1 and var2
------------------------------------------------
Variables
var1 : integer
var2 : integer
Start
var1 <- 25
var2 <- 63
var2 <- var1
var1 <- var2
Print("Permuted variables are: var1 = ", var1, " and var2 = ", var2)
End
</pre></div>
</td></tr></table></div>
<ol class="arabic simple">
<li>Write the trace table of the algorithm <em>permutation_V0</em> and explain why it is wrong.</li>
<li>Propose a new version <em>permutation_V1</em> that correct the algorithm (use a third variable).</li>
</ol>
</div>
<div class="section" id="accumulation">
<span id="sec-chap3-accumulation"></span><h3>4.3.3.2. Accumulation<a class="headerlink" href="#accumulation" title="Permalink to this headline">¶</a></h3>
<p>The value of an <strong>accumulation</strong> variable increases during the execution of the algorithm. As example, the following algorithm proposes to accumulate points during darts game with 3 throws.</p>
<div class="highlight-none notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21</pre></div></td><td class="code"><div class="highlight"><pre><span></span>Algorithm accumulation_V0
-------------------------
Description
Three successive throws permits to accumulate point at darts game
--------------------------------
Variables
points : integer /to read points of a throw
score : integer /to accumulate points
Start
Print("Enter the first throw points: ")
Read(points)
score <- score + points
Print("Enter the second throw points: ")
Read(points)
score <- score + points
Print("Enter the third throw points: ")
Read(points)
score <- score + points
Print("Your total score is: ", score)
End
</pre></div>
</td></tr></table></div>
<ol class="arabic simple">
<li>This algorithm is wrong. Explain why.</li>
<li>Propose a new version <em>accumulation_V1</em> that correct the algorithm</li>
</ol>
</div>
<div class="section" id="if-conditional-instructions">
<h3>4.3.3.3. if conditional instructions<a class="headerlink" href="#if-conditional-instructions" title="Permalink to this headline">¶</a></h3>
<p>Consider the two following algorithm:</p>
<div class="highlight-none notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11
12
13
14</pre></div></td><td class="code"><div class="highlight"><pre><span></span>Algorithm condition1
--------------------
Variables
e : integer
Start
Print("Enter an integer:")
Read(e)
if (e<0) then
e = e + 10
else
e = e - 10
endif
Print("New value: ", e)
End
</pre></div>
</td></tr></table></div>
<div class="highlight-none notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15</pre></div></td><td class="code"><div class="highlight"><pre><span></span>Algorithm condition2
--------------------
Variables
e : integer
Start
Print("Enter an integer:")
Read(e)
if (e<0) then
e = e + 10
endif
if (e>=0) then
e = e - 10
endif
Print("New value: ", e)
End
</pre></div>
</td></tr></table></div>
<ol class="arabic simple">
<li>Write the trace table for each algorithm with value for e = 20, -20 and -2</li>
<li>Are these two algorithm equivalent ?</li>
</ol>
<p>We want an algorithm that asks for three values entered by user and prints the maximum.</p>
<ol class="arabic simple" start="3">
<li>Write this algorithm.</li>
<li>Verify your algorithm using a trace table and different input values.</li>
</ol>
</div>
<div class="section" id="while-repetitive-instructions">
<h3>4.3.3.4. While repetitive instructions<a class="headerlink" href="#while-repetitive-instructions" title="Permalink to this headline">¶</a></h3>
<p>Consider the following algorithm:</p>
<div class="highlight-none notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11
12</pre></div></td><td class="code"><div class="highlight"><pre><span></span>Algorithm repetitive1
---------------------
Variables
x : integer
Start
x <- 42
while (x>=0)
Print ("Current value: ", x)
x <- x - 11
endwhile
Print ("Last value: ", x)
End
</pre></div>
</td></tr></table></div>
<ol class="arabic simple">
<li>Write the trace table of this algorithm and give the final value for x.</li>
</ol>
<p>Consider the following algorithm:</p>
<div class="highlight-none notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11
12
13</pre></div></td><td class="code"><div class="highlight"><pre><span></span>Algorithm repetitive2_V0
------------------------
Variables
i, x : integer
Start
i <- 0
x <- 2
while (x < 4)
Print ("Current value: ", x)
i <- i + 1
endwhile
Print ("Last value: ", x)
End
</pre></div>
</td></tr></table></div>
<ol class="arabic simple" start="2">
<li>This algorithm is wrong as it contains an infinite loop. Propose a corrected version for this algorithm and write its trace table.</li>
</ol>
</div>
<div class="section" id="for-repetitive-instruction">
<h3>4.3.3.5. For repetitive instruction<a class="headerlink" href="#for-repetitive-instruction" title="Permalink to this headline">¶</a></h3>
<p>Consider the following algorithm</p>
<div class="highlight-none notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19</pre></div></td><td class="code"><div class="highlight"><pre><span></span>Algorithm accumulation_V2
-------------------------
Description
3 successive throws permits to accumulate point at darts game
--------------------------------
Variables
points : integer /to read points of a throw
score : integer /to accumulate points
i: integer /loop variable
Start
score <- 0
for i from 1 to 3 (include)
Print("Enter the ", i, " throw points: ")
Read(points)
score <- score + points
endfor
Print("Your total score is: ", score)
End
</pre></div>
</td></tr></table></div>
<ol class="arabic simple">
<li>Write the trace table of this algorithm and compare it to the preceding algorithm accumulation_V1 of section <a class="reference internal" href="#sec-chap3-accumulation"><span class="std std-ref">Accumulation</span></a>.</li>
<li>Write an algorithm that asks n real to a user (n is also given by user) and prints the average.</li>
</ol>
</div>
<div class="section" id="using-and-writting-functions">
<h3>4.3.3.6. Using and writting functions<a class="headerlink" href="#using-and-writting-functions" title="Permalink to this headline">¶</a></h3>
<p>Consider that you dispose the description (and not the definition) of the following functions:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>units(number : integer) : integer
/Returns the number of units in the positive integer number
/ex : units(56) will return 6
tens(number : integer) : integer
/Returns the number of tens in the positive integer number
/ex : units(56) will return 5
hundreds(number : integer) : integer
/Returns the number of hundreds in the positive integer number
/ex : units(56) will return 0
</pre></div>
</div>
<ol class="arabic simple">
<li>Write an algotrithm that asks user for a positive number and prints the reversed corresponding number (ex : 156 -> 651)</li>
<li>Write the two functions tens and hundreds, the units fonction definition being:</li>
</ol>
<div class="highlight-none notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
2
3
4
5
6
7
8
9</pre></div></td><td class="code"><div class="highlight"><pre><span></span>Function units(number : integer) : integer
------------------------
Description
Returns the number of units in the positive integer number
ex : units(56) will return 6
------------------------
Start
return number%10 / % is for the remainder of euclidian division
End
</pre></div>
</td></tr></table></div>
</div>
<div class="section" id="playing-with-arrays">
<h3>4.3.3.7. Playing with arrays<a class="headerlink" href="#playing-with-arrays" title="Permalink to this headline">¶</a></h3>
<p>Consider the following algorithm that allows a user to enter 5 real numbers in an array:</p>
<div class="highlight-none notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11
12
13</pre></div></td><td class="code"><div class="highlight"><pre><span></span>Algorithm playArrays
--------------------
Constants
N = 5
Variables
myArray : array[5] of real
i : integer
Start
for i from 0 to N-1
Print ("Enter case", i+1, " of array:)
Read(myArray[i])
endfor
End
</pre></div>
</td></tr></table></div>
<ol class="arabic simple">
<li>Add to this algorithm instructions for printing the array.</li>
<li>Add to this algorithm instructions for reversing the array. You can help with the permutation algorithm of section <a class="reference internal" href="#sec-chap3-permutation"><span class="std std-ref">Permutation</span></a> under a function form.</li>
</ol>
<p>Example of reversed array:</p>
<table border="1" class="docutils">
<colgroup>
<col width="35%" />
<col width="15%" />
<col width="13%" />
<col width="11%" />
<col width="11%" />
<col width="15%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">original array</th>
<th class="head">3.2</th>
<th class="head">40.0</th>
<th class="head">1.0</th>
<th class="head">5.0</th>
<th class="head">-26.1</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>reversed array</td>
<td>-26.1</td>
<td><ol class="first last arabic simple" start="5">
<li></li>
</ol>
</td>
<td><ol class="first last arabic simple">
<li></li>
</ol>
</td>
<td><ol class="first last arabic simple" start="40">
<li></li>
</ol>
</td>
<td>3.2</td>
</tr>
</tbody>
</table>
<ol class="arabic simple" start="3">
<li>Write a function that sorts the array (ascending or descending)</li>
</ol>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="chap4_cLangage_Chap.html" class="btn btn-neutral float-right" title="5. C/C++ Programming Langage" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="chap3_2algorithmSyntax.html" class="btn btn-neutral float-left" title="4.2. Algorithm Syntax" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2019, Polytech ME Info team : LB, CM, FP, JV
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>