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