Skip to content · ⁨본문 바로가기⁩

Smallest and largest

English

Smallest and largest

Find both ends of a list in a single pass.

Keep two values at once, both starting as the first item. Check each number against both: it may replace the smallest, the largest, or neither.

한국어

최솟값과 최댓값

리스트의 양끝을 한 번의 순회에서 찾으십시오.

처음 항목으로 시작하는 두 개의 값을 동시에 유지하십시오. 각 숫자를 두 값 모두와 비교하십시오: 최솟값을 교체하거나, 최댓값을 교체하거나, 혹은 아무것도 교체하지 않을 수도 있습니다.

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP