Yes, your algorithm is in linear time, but as correctly pointed out by @Tushar with 2N comparisons.
First, here goes an adaptation of your algorithm, with fewer comparisons and without building the array of [0, n].
def minmax(inputarray):
lowest = highest = inputarray[0]
for i in inputarray:
if (i < lowest):
lowest = i
elif (i > highest):
highest = i
return (lowest, highest)
Then, this is an implementation with 1.5N comparisons and with generators so that we are cheap on memory:
from itertools import islice, izip
def minmax(inputarray):
mid = len(inputarray) / 2
lowest = highest = inputarray[mid]
iseven = mid * 2 == len(inputarray)
left = islice(inputarray, 0, mid)
right = islice(inputarray, mid + (0 if iseven else 1), len(inputarray))
for x, y in izip(left, right):
l, h = (x, y) if x < y else (y, x)
if l < lowest:
lowest = l
if h > highest:
highest = h
return (lowest, highest)
Result (the latter algorithm):
>>> minmax([0., -1.2, -33, 25, 1.4, 0])
(-33, 25)
>>> minmax([0., -1.2, -33, 25, 1.4])
(-33, 25)