Thank you Novo. But I want to save one data, not two.
In this case
dat[23] = 12;
won't work.
An one-value alternative is Index<int>, but you will be unable to write the code line above.
If your range of indices is small and sparse, you can just use regular Vector.
Another approach is to store data in a Vector and sort it, after that you will be able to use algorithms on sorted ranges.