find second largest number in an array
Utilisateur anonyme
i gave generic question solution: find k largest number in an array using min heap method, time compexity is knlogk. so for second largest, it is 2n. it is same as not using heap, but traver array once, keep track of largest and second largest number. the interview seem not satisfied of my answer, so good luck!