largest and smallest element in array with [seudocode