Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 List Correspondence
Index -> Programming, Python -> Python Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mms6




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: 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] ?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
mms6




PostPosted: Thu Oct 08, 2009 10:18 am   Post subject: RE:List Correspondence

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




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Python -> Python Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: