- #1

- 8

- 0

Please Help me on how to solve this type of question I am clueless.

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- Thread starter modzz
- Start date

- #1

- 8

- 0

Please Help me on how to solve this type of question I am clueless.

- #2

- 8

- 0

This does not answer my question though..

- #3

- 26

- 0

O(n) time algorithm seems possible.

You have n integers stored in an array, each having an index.

When going through each index,

1. if it is an even number, store it with an index. Otherwise go through next index.

2. Compare it with the stored value if it is an even integer, and update the stored value if it is an even integer and it is bigger than the stored value.

3. .........

Remaining steps would be trivial.

You have n integers stored in an array, each having an index.

When going through each index,

1. if it is an even number, store it with an index. Otherwise go through next index.

2. Compare it with the stored value if it is an even integer, and update the stored value if it is an even integer and it is bigger than the stored value.

3. .........

Remaining steps would be trivial.

Last edited:

Share: