a specific problem. Computer program: a code for solving a problem but written in a language understandable by computer or compiler. a specific implementation of an algorithm.
after a finite number of steps. definiteness: Each step must be precisely defined. input: An algorithm has zero or more inputs, taken from a specified set of objects. output: An algorithm has one or more outputs, which have a specified relation to the inputs. effectiveness: An algorithm must give correct answer (output).
for index in range(0, len(alist)): minpos = index minvalue = alist[index] for index1 in range(index, len(alist)): if (alist[index1] < minvalue): minpos = index1 minvalue = alist[index1] temp = alist[index] alist[index] = alist[minpos] alist[minpos] = temp
itertools.permutations(alist): if (check_in_order (list(i))): return i def check_in_order (alist): for i in range(len(alist)-1): if alist[i]>alist[i+1]: return False return True