VibraXX
Live Quiz Arena
🎁 1 Free Round Daily
⚡ Enter Arena
HomeCategoriesLogic & PuzzlesQuestion
Question
Logic & Puzzles

If a sorting algorithm's progress is measured by a monovariant that strictly decreases with each swap until the array is sorted, which property holds?

A)Runtime complexity is O(n^3)
B)The algorithm will always terminate
C)Memory usage is always minimal
D)Swaps are always adjacent elements

💡 Explanation

Because the monovariant strictly decreases and is bounded below (e.g., by 0), the algorithm must eventually terminate; otherwise, the monovariant would decrease infinitely. Therefore, the algorithm will terminate, rather than continue indefinitely, due to a guarantee of forward progress.

🏆 Up to £1,000 monthly prize pool

Ready for the live challenge? Join the next global round now.
*Terms apply. Skill-based competition.

⚡ Enter Arena

Related Questions

Browse Logic & Puzzles