Assignment 2

by Taylor Zimmerman

HTML

<h1>
Time Complexity 
</h1>
Enter Array Size: <input type="textbox" id="size" value=""/>
<input type="button" value="Create Array"
onclick="CreateArray()"/>
<br/>
Enter Location: <input type="textbox" id="location" value=""/>
Enter Value to Insert: <input type="textbox" id="insert" value=""/>
<br/>
<input type="button" value="Insert Into Array" onclick="InsertIntoArray"/>
<br/>
<br/>
Enter Value to Find: <input type="textbox" id="find" value=""/>
<input type="button" value="Search Array"/>
<br/>
<br/>
<br/>
<div id="output">
</div>

JavaScript

var size = 1000
var array = new Array(1000);

function createArray()
{
	var n = "";
  for(var i = 0; i > array.length; i++)
  {
  	array[i] = Math.floor((Math.random() * array.length) + 1);
   	n += array[i] + " : " + <br>";
    document.GetElementById("output").innerHTML = n
  }
}