Answer:
word = input('Enter a single word: ', 's');
n = length(word);
nodupWord = [];
for i = 1:n
dup = false;
c = word(i);
for j = 1:i-1
if word(j) == c
dup = true;
break;
end
end
if ~dup
nodupWord = [nodupWord, c]; %add the non-duplicate char to end
end
end
disp(['Adjusted word: ', nodupWord])
Explanation:
The code is in Python.
Answer:
polynomial-bounded algorithms
Explanation:
There are two algorithm complexities and they are time and space complexities. They can be denoted with the big-O notation. The big-o notation for a time and space complexity gets the worst-case time and space respectively.
The time complexity gets the measure of the execution time of an algorithm. When the time function is a polynomial ( k^n + k^n-1 ...) then the algorithm is said to be a polynomial-bounded algorithm.
I believe the correct answer is choice D. Making a law.
I don't believe the scientific method says anything about making a law.
I hope this helps you and have a great day!