<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3Alab-3%3Atsen009</id>
	<title>SE250:lab-3:tsen009 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3Alab-3%3Atsen009"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-3:tsen009&amp;action=history"/>
	<updated>2026-04-28T22:36:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.kram.nz/index.php?title=SE250:lab-3:tsen009&amp;diff=5897&amp;oldid=prev</id>
		<title>Mark: 6 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-3:tsen009&amp;diff=5897&amp;oldid=prev"/>
		<updated>2008-11-03T05:19:30Z</updated>

		<summary type="html">&lt;p&gt;6 revision(s)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Web page under construction... please GO AWAY!!! come again later... hehe... &lt;br /&gt;
&lt;br /&gt;
im serious, go away already....&lt;br /&gt;
&lt;br /&gt;
u sure dont listen do you...&lt;br /&gt;
&lt;br /&gt;
==Task==&lt;br /&gt;
The task was to pretty much mess around with array lists, and how they work and the time they usually take to compile/run.&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
===Task 1===&lt;br /&gt;
simply add the following code to the bottom of the given arraylist.c&lt;br /&gt;
&lt;br /&gt;
 int main (){&lt;br /&gt;
 	ArrayList bob;&lt;br /&gt;
 	int i=0;&lt;br /&gt;
 	arraylist_init(&amp;amp;bob);&lt;br /&gt;
 	clock_t start = clock();&lt;br /&gt;
 &lt;br /&gt;
 	for (i= 0; i &amp;lt; 1000000; i++){&lt;br /&gt;
 		arraylist_push(&amp;amp;bob, 1);&lt;br /&gt;
 	}&lt;br /&gt;
 	clock_t finish = clock();&lt;br /&gt;
 &lt;br /&gt;
 	printf(&amp;quot;to add %d elements to the array list took %f seconds\n&amp;quot;, i, (double)(finish - start));&lt;br /&gt;
 &lt;br /&gt;
 	return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
and at the top, make sure you have these libraries,&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;		/* for printf */&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;		/* for malloc, realloc, free */&lt;br /&gt;
 #include &amp;lt;string.h&amp;gt;		/* for memmove */&lt;br /&gt;
 #include &amp;lt;assert.h&amp;gt;		/* for assert */&lt;br /&gt;
 #include &amp;lt;time.h&amp;gt;               /* for the clock */&lt;br /&gt;
 #include &amp;quot;arraylist.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
for the computer it was tested, the result lookd something like this,&lt;br /&gt;
&lt;br /&gt;
 to add &amp;#039;&amp;#039;&amp;#039;1000000&amp;#039;&amp;#039;&amp;#039; elements to the array list took &amp;#039;&amp;#039;&amp;#039;31.000000 seconds&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>