Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do algorithms text book uses "nondecreasing" instead of "increasing" to mention sorted array?

Is there any particular reason? or it's just the preference of author? For example here's the Kruskal algorithm from CLRS:

Kruskal's algorithm

like image 640
bits Avatar asked Dec 12 '16 00:12

bits


1 Answers

Nondecreasing means that the values could stay the same - they don't decrease but they could increase or stay the same.

The values 1, 1, 1, 2 are in nondecreasing order but 1, 2, 3, 4 are increasing.

like image 147
Simeon Visser Avatar answered Sep 30 '22 17:09

Simeon Visser