-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathtestprograms.html
278 lines (272 loc) · 12.4 KB
/
testprograms.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
<!Doctype html>
<html lang="en">
<head>
<title>TEST PROGRAMS</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header class="center clearfix" id="navtop"> <a href="index.html" class="logo fleft"><img src="img/logo.png" alt=""></a>
<nav class="fright">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="roadmap.html">Roadmap</a></li>
<li><a href="documentation.html" class="navactive">Documentation</a></li>
</ul>
</nav>
</header>
<div class="about center part clearfix">
<header class="title">
<h3 class="fleft">Contents</h3>
</header>
<body>
<aside class="column4 mright">
<menu>
<ul>
<li><a href="#test1" class="sec">Test Program 1</a></li>
<li><a href="#test2" class="sec">Test Program 2</a></li>
<li><a href="#test3" class="sec">Test Program 3</a></li>
<li><a href="#test4" class="sec">Test Program 4</a></li>
<li><a href="#test5" class="sec">Test Program 5</a></li>
<li><a href="#test6" class="sec">Test Program 6</a></li>
<li><a href="#test7" class="sec">Test Program 7</a></li>
<li><a href="#test8" class="sec">Test Program 8</a></li>
<li><a href="#test9" class="sec">Test Program 9</a></li>
<li><a href="#test10" class="sec">Test Program 10</a></li>
<li><a href="#test11" class="sec">Test Program 11</a></li>
<li><a href="#test12" class="sec">Test Program 12</a></li>
<li><!--For blank space between lins and download button--> </li>
<!-- <li><a href="https://github.com/silcnitc/documentation/blob/master/lex/Lex.pdf?raw=true" class="button"> Download as PDF </a></li> -->
<li><!--Blank line for space between download button and main title--> </li>
</ul>
</menu>
</aside>
<section class="columnthird content"><h2 class="mright">TEST PROGRAMS</h2>
<article id="test1" class="detail">
<h4>Test Program 1 : Bubblesort (iterative)</h4>
<p>
This test program reads elements into an array and sorts them using the classic bubblesort algorithm. (iterative version)
</p>
<p>
<b> Input </b> : 1. Number of elements to be sorted from standard input.
2. Elements to be sorted
</p>
<p>
<b> Output </b> : A sorted array of elements.
</p>
<p>
This program test the iteration, conditional and arrays.
</p>
<p> The code for the test progam can be found <a href="testprograms/test1.html" target="_blank">here</a>
</article>
<article id="test2" class="detail">
<h4>Test Program 2 : <a href="https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm" target="_blank">Extended Euclid algorithm</a> (iterative version and with functions)</h4>
<p>
This test program calculates the GCD (Greatest Common Divisor) of two numbers along with Bezout co-efficients. (iterative version)
</p>
<p>
<b> Input </b> : Two numbers
</p>
<p>
<b> Output </b> : GCD of the given two numbers and Benoud co-efficients.
</p>
<p>
This program test the iteration, parameter passing, passing of user-defined datatype as return value of function.
</p>
<p> The code for the test progam can be found <a href="testprograms/test2.html" target="_blank">here</a>
</article>
<article id="test3" class="detail">
<h4>Test Program 3 : Bubblesort (recursive)</h4>
<p>
This test program reads elements into an array and sorts them using the classic bubblesort algorithm. (recursive version)
</p>
<p>
<b> Input </b> : 1. Number of elements to be sorted from standard input. <br>
2. Elements to be sorted
</p>
<p>
<b> Output </b> : A sorted array of elements.
</p>
<p>
This program test the recursion, conditional and arrays.
</p>
<p> The code for the test progam can be found <a href="testprograms/test3.html" target="_blank">here</a>
</article>
<article id="test4" class="detail">
<h4>Test Program 4 : <a href="https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm" target="_blank">Extended Euclid algorithm</a> (recursive)</h4>
<p>
This test program calculates the GCD (Greatest Common Divisor) of two numbers along with Bezout co-efficients. (recursive version)
</p>
<p>
<b> Input </b> : Two numbers
</p>
<p>
<b> Output </b> : GCD of the given two numbers and Benoud co-efficients.
</p>
<p>
This program test the recursion, parameter passing, passing of user-defined datatype as return value of function.
</p>
<p> The code for the test progam can be found <a href="testprograms/test4.html" target="_blank">here</a>
</article>
<article id="test5" class="detail">
<h4>Test Program 5 : Factorial (recursive)</h4>
<p>
This test program calculates and prints out the factorial of the first n numbers.
</p>
<p>
<b> Input </b> : Value of n read from standard input.
</p>
<p>
<b> Output </b> : Value of n!.
</p>
<p>
This program test the working of recursive functions.
</p>
<p> The code for the test progam can be found <a href="testprograms/test5.html" target="_blank">here</a>
</article>
<article id="test6" class="detail">
<h4>Test Program 6 : Quicksort (recursive)</h4>
<p>
This test program reads elements into an array and sorts them using the classic quicksort algorithm. (recursive version)
</p>
<p>
<b> Input </b> : 1. Number of elements to be sorted from standard input. <br>
2. Elements to be sorted
</p>
<p>
<b> Output </b> : A sorted array of elements.
</p>
<p>
This program test the recursion, conditional and arrays.
</p>
<p> The code for the test progam can be found <a href="testprograms/test6.html" target="_blank">here</a>
</article>
<article id="test7" class="detail">
<h4>Test Program 7 : Constant Function</h4>
<p>
This test program calculates the value of a function f(x) given by :<br>
f(x) = 91 if x>=91; <br>
f(f(x+11)) if x<91 <br>
So, the value of the function is always 91 for any given input number.
</p>
<p>
<b> Input </b> : A number
</p>
<p>
<b> Output </b> : 91.
</p>
<p>
This program test the recursion, parameter passing, calling a function inside the call of another function.
</p>
<p> The code for the test progam can be found <a href="testprograms/test7.html" target="_blank">here</a>
</article>
<article id="test8" class="detail">
<h4>Test Program 8 : Linked List</h4>
<p>
This test program reads elements into a linked list and prints them.
</p>
<p>
<b> Input </b> : Value of length of list and list of values from standard input.
</p>
<p>
<b> Output </b> : The list of values stored in linked list.
</p>
<p>
This program test the working of dynamic memory allocation functions like Initialize(), Alloc() and Free().
</p>
<p> The code for the test progam can be found <a href="testprograms/test8.html" target="_blank">here</a>
</article>
<article id="test9" class="detail">
<h4>Test Program 9 : Binary Search Tree</h4>
<p>
This test program inserts elements into a binary search tree and prints the elements in inorder, preorder and postorder traversal. The program stops taking input elements (that are to be inserted in Binary Search Tree) when the user enters 0.
</p>
<p>
<b> Input </b> : The elements that are to be inserted into a Binary Search Tree and a 0 at last (indicating the end of input).
</p>
<p>
<b> Output </b> : The inorder, preorder and postorder traversal of the tree.
</p>
<p>
This program test the iteration, recursion, conditional, arrays and passing of user-defined datatype as return value of function.
</p>
<p> The code for the test progam can be found <a href="testprograms/test9.html" target="_blank">here</a>
</article>
<article id="test10" class="detail">
<h4>Test Program 10 :Fibonacci Series</h4>
<p>
This program prints the nth fibonacci number.
</p>
<p>
<b> Input </b> : An integer n.
</p>
<p>
<b> Output </b> : Printing the nth fibonacci number.
</p>
<p>
This program test the recursion, conditional.
<p> The code for the test progam can be found <a href="testprograms/test10.html" target="_blank">here</a>
</article>
<article id="test11" class="detail">
<h4>Test Program 11 :Extended Euclid Algorithm using linkedlist</h4>
<p>
This program finds gcd of two numbers given by using Extended Euclid Algorithm and stores result in a linkedlist.
</p>
<p>
<b> Input </b> : Two numbers a and b.
</p>
<p>
<b> Output </b> : A list of numbers in every iteration of the algorithm a,b,d,s,t such that as+bt=d in each iteration are stored in a linkedlist and are printed finally by iterating the linked list.
</p>
<p>
This program test the iteration, recursion, conditional, passing of user-defined datatype as return value of function.
</p>
<p> The code for the test progam can be found <a href="testprograms/test11.html" target="_blank">here</a>
</article>
<article id="test12" class="detail">
<h4>Test Program 12 :Extended Euclid Algorithm (Iterative version without functions)</h4>
<p>
This test program calculates the GCD (Greatest Common Divisor) of two numbers along with Bezout co-efficients. (iterative version)
</p>
<p>
<b> Input </b> : Two numbers
</p>
<p>
<b> Output </b> : GCD of the given two numbers and Benoud co-efficients.
</p>
<p>
This program tests the iteration.
</p>
<p> The code for the test progam can be found <a href="testprograms/test12.html" target="_blank">here</a>
</article>
</section>
</body>
<footer class="center part clearfix">
<ul class="social column3 fleft">
<li><a href="https://github.com/silcnitc">Github</a></li>
<li> <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">
<img alt="Creative Commons License" style="border-width:0" src="img/creativecommons.png" /></a></li>
</ul>
<!-- <div class="up column3 mright"> <a href="#navtop" class="ir">Go up</a> </div> -->
<div class="up column3" style="color: black;">
<p style="font-weight: bold;">Contributed By : <a href="https://www.linkedin.com/in/dattathallam">Thallam Sai Sree Datta</a>, <br>        <a href="https://www.linkedin.com/in/n-ruthviik-0a0539100">N Ruthvik</a>
</p>
</div>
<nav class="column3">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<!-- <li><a href="uc.html">Contact</a></li> -->
</ul>
</nav>
</footer>
<!-- Javascript - jQuery
<script src="http://code.jquery.com/jquery.min.js"></script>-->
<script>window.jQuery || document.write('<script src="js/jquery-1.7.2.min.js"><\/script>')</script>
<!--[if (gte IE 6)&(lte IE 8)]>
<script src="js/selectivizr.js"></script>
<![endif]-->
<script src="js/scripts.js"></script>
<script src="js/inject.js"></script>
</html>