diff --git a/C++/ArrayList/sort-binary-array.cpp b/C++/ArrayList/sort-binary-array.cpp new file mode 100644 index 0000000..d664e51 --- /dev/null +++ b/C++/ArrayList/sort-binary-array.cpp @@ -0,0 +1,71 @@ +/* + sort binary array + Object oriented code + author : singhanandVEVO + +*/ +#include +using namespace std; + +class BinaryArray { + + public: + int i,N; + vector A; + + void setN(int n) { + N = n; + } + + void sortBinaryArray() { + if(N==1) + return; + int left = -1; + for(i=0;i>val; + A.push_back(val); + + } + } + + void printArray() { + for(i=0;i>T; + BinaryArray B; + while(T--) { + int n; + cin>>n; + B.setN(n); + B.processTestCase(); + } + return 0; +} \ No newline at end of file