Frage im Vorstellungsgespräch bei Convo.com

Write and algorithm to find the second highest number in an integer array?

Antworten zu Vorstellungsgespräch

Anonym

26. März 2017

wrote the code.

Anonym

27. Sept. 2024

Example: Let’s say your array is {5, 2, 9, 1, 5, 6}. Write down: 5, 2, 9, 1, 5, 6. Remove duplicates: 5, 2, 9, 1, 6 (unique values). Sort in descending order: 9, 6, 5, 2, 1. Identify the second highest: The second highest number is 6.