118 lines
7.1 KiB
HTML
118 lines
7.1 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.18"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Sorting and Searching Algorithms: Main Page</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">Sorting and Searching Algorithms
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.18 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="PageDoc"><div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">Sorting and Searching Algorithms Documentation</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><h1><a class="anchor" id="intro"></a>
|
|
Introduction</h1>
|
|
<p>The implementation and evaluation of a collection of Sorting and Searching Algorithms.</p>
|
|
<h1><a class="anchor" id="objective"></a>
|
|
Assignment Objective</h1>
|
|
<p>The target collection those algorithms are operation on, is an 'Array Backed List'. This list shares (almost) the same interface (<code>list.h</code>) as the linked list from previous assignments but is implemented based on an array. Different sorting and searching algorithms are to be implemented using that list. A stopwatch shall be implemented that is used to measure the time a certain algorithm requires to sort or search. Eventually the measured times for defined number of list items and algorithms are compared.</p>
|
|
<p><b>Configuration</b></p>
|
|
<p>The capacity of the backing array of the list is defined in <code>config.h</code> as <code>#define CAPACITY_INCREMENT</code>. This value defines also the number of items for enlarging the backing array. This means, the array grows always in steps of <code>CAPACITY_INCREMENT</code> items.</p>
|
|
<h1><a class="anchor" id="assignment"></a>
|
|
Assignment</h1>
|
|
<p>In this assignment various sorting and search algorithms shall be implemented in multiple steps.</p>
|
|
<p><b>Step 1:</b></p>
|
|
<p>Implemenation of an 'Array Backed List' by implementing files <code>array_backed_list.h</code>. This file implements <code>list.h</code> using an array as underlying collection instead of a linked list. In contrast to earlier assignments, the function <code>list_append(…)</code> was removed and <code>list_swap(…)</code> was added. The array shall have a certain capacity and need to be increased (with all consequences, such as of copying items) if another item is added to a 'full' list. As a benefit, random access to items is fast, which is required by (most) sorting and searching algorithms. For implementation details read and follow the instructions in file <code>array_backed_list.c</code>.</p>
|
|
<p><b>Step 2:</b></p>
|
|
<p>Implementation of the infrastructure for selecting and using sorting and searching algorithms as well as for measuring the time a certain algorithm takes for completing its operation.</p>
|
|
<p><b>Step 3:</b></p>
|
|
<p>Implemenation of the following sorting algorithms:</p><ul>
|
|
<li>- TO BE DEFINED –</li>
|
|
</ul>
|
|
<p>The library 'allocator' is provided for memory allocation functionality that integrates with unit testing. Behind the facade, allocats memory dynamically similar to <code>malloc</code>. Allocated memory must be freed when it is not used anymore. The 'allocator' library must be used for memory alloction operations, otherwise unit tests will fail.</p>
|
|
<ol type="1">
|
|
<li>Implement 'array_backed_list.c' against interface indirectly declared in 'list.h': Make the program and tests compile: Implement all functions in all relevant files declared in the headers EMTPY (return nothing, 0, false, ... as required).<ul>
|
|
<li>All unit tests shall run but FAIL after this step</li>
|
|
<li><b>–COMMIT–</b></li>
|
|
</ul>
|
|
</li>
|
|
<li>Implement the empty functions one by one to make the unit tests.<ul>
|
|
<li>Because most unit tests depends on <code>list_obtain(…)</code>, <code>list_release(…)</code>, <code>list_is_valid(…)</code>, <code>list_is_empty(…)</code>, <code>list_insert(…)</code>, and <code>list_get_size(…)</code> it makes sense to implement those functions in one step.</li>
|
|
<li>The purpose of a function is specified as API documentation within the header files.</li>
|
|
<li>Obey comments in source files. Run the unit tests frequently and fix failures.</li>
|
|
<li><b>–COMMIT– after each implemented function.</b></li>
|
|
</ul>
|
|
</li>
|
|
</ol>
|
|
<h1><a class="anchor" id="notes"></a>
|
|
Notes</h1>
|
|
<ol type="1">
|
|
<li>make cleantest: This new make target for clearing the console, building, and running unit test is available.</li>
|
|
<li>Sometimes changes are not properly detected by incremental builds. If something very strange happens during compilation, try to run <code>make clean</code> followed by <code>make</code> to start a clean build. This approach is also recommended after everthing is done, because some compiler warning appears only in clean builds. </li>
|
|
</ol>
|
|
</div></div><!-- PageDoc -->
|
|
</div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated on Mon Mar 15 2021 21:29:58 for Sorting and Searching Algorithms by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.18
|
|
</small></address>
|
|
</body>
|
|
</html>
|