This entry was posted in Test #1 Review. Bookmark the permalink.

6 Responses to Review

  1. Benjamin Lin says:

    if ai is even then ai>=m??
    I don’t understand that line. Why did you put condition with another condition, after the then statement, there should be a assignment statement (“=”).
    it should be
    if ai is even
    if p = 0
    m = ai
    p = i
    else if ai>m
    m = ai
    p = i

  2. Benjamin Lin says:

    Sorry, I don’t know how to delete the repeat comment and for some reason it post 3 times.

  3. Kate Poirier says:

    I think Benjamin is onto something here; the “if/then” statement is confused here. Probably you wanted something more like, “if a_i is even and a_i \geq m, then…” It looks like you’ve also used “P” and “m” to stand for the same thing, so it’s hard to tell what this algorithm would actually return.

Leave a Reply

Your email address will not be published. Required fields are marked *