Write in pseudocode the algorithm for determining the average value of an UNSORTED array of numbers, given an array of "a" with number of elements that have a value "length".
Additionally, what is its order in Big-O? If the array of numbers were ordered, can the algorithm change? If so, what is its Big-O?