3

"take as input.."

I have no idea what that means..

for example, I extracted a sentence from Google by searching, such as

"Describe an algorithm that takes as input a list of n integers".

What is the meaning of the sentence?

3 Answers 3

2

In writing that sentence, I assume that you are a programmer. To 'take as input' means to accept it into your algorithm.

In C, you might express this notion as

int algorithm(int arrayAsInput[])

{

. . .

return output;

}

1

It means that is the nature of the data that goes into the algorithm.

If the algorithm were a function expressable as f(x1, x2,.....xn), it would be the set of numbers x1 through xn, which is also called the "argument" of that function.

1

"Describe an algorithm that takes as input a list of n integers".

The sentence can be re-written as:

"Describe an algorithm. This algorithm needs to accept input. That input is a list of n integers."

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .