Implement the following algorithms and analyze its expected (average) and worst run time complexities. You should work through the functions one by one, making comments and identifying the complexity of each part of the algorithm. If you are unsure of how the algorithms scale, then try adding counter variables and incrementing them each time an operation takes place. By logging out the counters for different sizes of input you should be able to see a trend developing.
Write a program that determines if an input is even or odd. Explain its average and worst run time
Write a program that doubles every value in an array. Explain its average and worst run time
Write an algorithm to find an element randomly in the given array. Explain its average and worst run time
Write an algorithm that creates pairs that you can work with every day. Each pair be only printed once and you can't pair with yourself. Explain your algorithm's average and worst run time
var people = ["JP", "Dennell", "Benjamin", "Paul", "Donna", "Emily"];
function createPairs (arr){
}
createPairs(people);
Write an algorithm to determine if a given number is prime or not. Explain its average and worst run time
Given two arrays, write an algorithm to determine whether values from the first array is present in the second array. Explain its average and worst run time
Write an algorithm that finds the element with the minimum value in an array. Explain its average and worst run time.