<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>YourSearchBuddy &#187; array</title>
	<atom:link href="http://www.yoursearchbuddy.com/tag/array/feed" rel="self" type="application/rss+xml" />
	<link>http://www.yoursearchbuddy.com</link>
	<description>your search ends here</description>
	<lastBuildDate>Tue, 31 Jan 2012 19:47:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Array, ArrayList and List in C#</title>
		<link>http://www.yoursearchbuddy.com/array-arraylist-list</link>
		<comments>http://www.yoursearchbuddy.com/array-arraylist-list#comments</comments>
		<pubDate>Mon, 28 Jun 2010 15:19:57 +0000</pubDate>
		<dc:creator>lokeshlal</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[arraylist]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[list]]></category>

		<guid isPermaLink="false">http://yoursearchbuddy.com/?p=641</guid>
		<description><![CDATA[class program { static void main(strings[] args) { Console.WriteLine("*************Array Test*************"); DateTime stTm = DateTime.Now; Console.WriteLine("Start Time : " + DateTime.Now.ToString()); for (int i = 0; i &#60; 9999999; i++) {... <a class="meta-more" href="http://www.yoursearchbuddy.com/array-arraylist-list">Read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<pre>
class program
{
	static void main(strings[] args)
	{
		Console.WriteLine("*************Array Test*************");
		DateTime stTm = DateTime.Now;
		Console.WriteLine("Start Time : " + DateTime.Now.ToString());
		for (int i = 0; i &lt; 9999999; i++)
		{
			a.SetValue(i, i);
			//a[i] = i;   //Cannot apply indexing with []
                                                     //to an expression of type &#39;System.Array&#39;	

		}
		for (int i = 0; i &lt; 9999999; i++)
		{
			object o = a.GetValue(i);
			//object o = a[i];   //Cannot apply indexing with []
                                                               //to an expression of type &#39;System.Array&#39;
		}
		Console.WriteLine(&quot;End Time : &quot; + DateTime.Now.ToString());
		Console.WriteLine(&quot;Time taken : &quot; + DateTime.Now.Subtract(stTm));

		Console.WriteLine(&quot;*************ArrayList Test*************&quot;);
		stTm = DateTime.Now;
		Console.WriteLine(&quot;Start Time : &quot; + DateTime.Now.ToString());
		for (int i = 0; i &lt; 9999999; i++)
		{
			al.Add(i);
		}
		for (int i = 0; i &lt; 9999999; i++)
		{
			object o = al[i];
		}
		Console.WriteLine(&quot;End Time : &quot; + DateTime.Now.ToString());
		Console.WriteLine(&quot;Time taken : &quot; + DateTime.Now.Subtract(stTm));

		Console.WriteLine(&quot;*************List Test*************&quot;);
		stTm = DateTime.Now;
		Console.WriteLine(&quot;Start Time : &quot; + DateTime.Now.ToString());
		for (int i = 0; i &lt; 9999999; i++)
		{
			l.Add(i);
		}
		for (int i = 0; i &lt; 9999999; i++)
		{
			int o = l[i];
		}
		Console.WriteLine(&quot;End Time : &quot; + DateTime.Now.ToString());
		Console.WriteLine(&quot;Time taken : &quot; + DateTime.Now.Subtract(stTm));

		Console.ReadLine();
	}
}
</pre>
<p>OUTPUt</p>
<pre>
*************Array Test*************
Start Time : 6/28/2010 8:50:21 PM
Disposed Object
Disposed Object
End Time : 6/28/2010 8:50:24 PM
Time taken : 00:00:02.7655896
*************ArrayList Test*************
Start Time : 6/28/2010 8:50:24 PM
End Time : 6/28/2010 8:50:25 PM
Time taken : 00:00:01.4843560
*************List Test*************
Start Time : 6/28/2010 8:50:25 PM
End Time : 6/28/2010 8:50:25 PM
Time taken : 00:00:00.2031224
</pre>
<p>As per this test, List are fastest, then ArrayList and then Arrays.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yoursearchbuddy.com/array-arraylist-list/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

