I have 1000 lines in a text file. I want to read them into some data structure[DS].
After reading them, I will be randomly picking 50 lines from the DS (using a Random Number Generator). Next time 50 more & 50 more the time after that. Each time I use 50 lines from the DS, I want to delete them from the DS. So after the first iteration, I will have 950 items, after the second iteration, I will have 900 & so on.
So 3 operations
- Read from file & insert lines into the DS
- Random access from the DS
- Delete members from the DS in a random manner.
Consider both these requirements, which would be the best DS to use?
FWIW, I will be coding this in python.