Sunday, September 26, 2010

Newly Sorted

begin
count list
repeat n times
is an1 < An to the right
move to the next
else
print no
end repeat print yes
end

This solution will work for any number of ns because it count's the list first before setting the repeat. It will work for any set of numbers because it just goes from left to right. The time it will take is set by the list only an infinite amount of numbers in the list will make it not finite. Any Permutation works


AZ Marketing  

No comments:

Post a Comment