I have an algoritm which takes many iterations, each of which scores items in a collection and removes the one with the highest score.
I could populate a Vector with the initial population, continually replacing it as a var, or choose a mutable collection as a val. Which of the mutable collections would best fit the bill?
You could consider a DoubleLinkedList, which has a convenient remove() method to remove the current list cell.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With