-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance stability checks in sort function
This version improves stability testing in the do_sort function by tracking node pointers and their original order to verify stable sorting. Unlike the previous version, which modified element_t, this iteration avoids altering the structure and instead relies on auxiliary data structures. However, the stability test is limited to a maximum number of elements, currently set as MAX_NO, to mitigate potential performance issues. Note: If the dataset is too large, it may lead to excessively long test times, hence the use of MAX_NO.
- Loading branch information
Showing
2 changed files
with
50 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,6 @@ | |
typedef struct { | ||
char *value; | ||
struct list_head list; | ||
unsigned no; | ||
} element_t; | ||
|
||
/** | ||
|