Because of my algorithm i have to insert some empty(NULL) nodes into my vector,some gaps i mean.How can i perform this?
I had tried like
array.push_back(NULL);
But it adds nodes with 0 value.
Edit:
I get values from integer array like int a[10000] and insert them into vector sirali_dizi with leaving some gaps into my vector.So i want to leave some gaps but with this every round i want to sort my array also.So i can’t use -1 or 0 etc.
You could make a vector of pointers to int instead of int:
And then access the values this way: