Added sorting criteria

This commit is contained in:
MarcUs7i 2025-05-07 18:20:12 +02:00
parent e25fbf7a3a
commit 3a0af23bde
2 changed files with 26 additions and 3 deletions

View file

@ -11,3 +11,25 @@
*/
#include "sorting_criteria.h"
/**
* Determines whether or not `fst` is smaller than or equal to `snd` (ascending order).
*
* @param fst The value that is supposed being smaller than `snd`.
* @param snd The value to compare.
* @return True if `fst` is smaller than or equal to `snd`, false otherwise.
*/
bool is_in_asc_order(int fst, int snd) {
return fst <= snd;
}
/**
* Determines whether or not `fst` is greater than or equal to `snd` (descending order).
*
* @param fst The value that is supposed being greater than `snd`.
* @param snd The value to compare.
* @return True if `fst` is greater than or equal to `snd`, false otherwise.
*/
bool is_in_desc_order(int fst, int snd) {
return fst >= snd;
}