Search(array[], size, key)
found = false
index = 0;
while not found and index < size
if array[index] = key
found = true
index = index + 1
return found
Search(array[], size, key)
index = 0;
poisiton = ITEM_NOT_FOUND
while position == ITEM_NOT_FOUND and index < size
if array[index] == key
position = index
index = index + 1
return position
NonSearchA(ary[], size, key)
for each element e in ary
if e == key
return true
else
return false
NonSearchB(ary[], size, key)
found = false;
for each element e in ary
if e == key
found = true
else
found = false
return found
SelectionSort(array, size)
for current = 0 to size-1 do
minPos = current
for j = current+1 to size do
if array[minPos] > array[j]
minPos = j;
if minPos != current
Swap(array[minPos], array[current])
InsertionSort(array, size)
for last = 1 to size
i = last;
tmp = array[last];
while i >= 1 and array[i-1] > tmp
array[i] = array[i-1]
i--;
array[i] = tmp