How to check if a vector is heap in C++

1 Answer

0 votes
#include <iostream>     
#include <algorithm>    
#include <vector>       

int main () {
  std::vector<int> vec {9, 8, 6, 4, 3, 1, 0};

  std::cout << is_heap(vec.begin(), vec.end());
 
}




/*
run:

1

*/

 



answered Nov 21, 2022 by avibootz
...