[英]How to check whether an array is sorted or not using is_sorted function in C++?
[英]How to check whether a linked list is sorted or not using c++?
c++ - 如何檢查數組或鏈表是否已排序或未使用 C++ 給定一組數字? 有沒有可以檢查的功能?
只需使用std::is_sorted
類似的東西:
if (std::is_sorted(std::begin(linked_list), std::end(linked_list)) {
//...
}
檢查此堆棧溢出鏈接,希望您能得到答案。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.