Simply use std::is_sorted
something like:
if (std::is_sorted(std::begin(linked_list), std::end(linked_list)) {
//...
}
solved How to check whether a linked list is sorted or not using c++?
Simply use std::is_sorted
something like:
if (std::is_sorted(std::begin(linked_list), std::end(linked_list)) {
//...
}
solved How to check whether a linked list is sorted or not using c++?