Computer Science Canada

List Correspondence

Author:  mms6 [ Wed Oct 07, 2009 10:39 pm ]
Post subject:  List Correspondence

The question state the conditions:

We informally define the term corresponding element as follows:
The first element and the last element of a list are corresponding elements.
Similarly, the second element and the element just before the last element are corresponding elements.
The third element and the element just before the element just before the last element are corresponding elements -- and so on.

Given that the variable a is associated with a list, write an expression for the corresponding element of a[i] .



But I really do not know how to start this.

Please help

Thanks a bunch.

Author:  Tony [ Wed Oct 07, 2009 10:44 pm ]
Post subject:  RE:List Correspondence

Ok, lets try it this way:

What is the corresponding element of a[0]? (The answer is in the question itself)
a[1] ? (also in the question)
a[2] ? (follow the patten)
...
a[i] ?

Author:  mms6 [ Thu Oct 08, 2009 10:18 am ]
Post subject:  RE:List Correspondence

Yes, but I do not know what "corresponding" mean.

Author:  Tony [ Thu Oct 08, 2009 11:38 am ]
Post subject:  Re: List Correspondence

read the question
mms6 @ Wed Oct 07, 2009 10:39 pm wrote:
We informally define the term corresponding element as follows:


to be fair, the definition is specialized to this question. It's really about finding pairs of elements, according to a rule.


: