P
paradox
Basically I have an ArrayList of strings; I need a fast way of
searching through and comparing the elements of the ArrayList and the
return an ArrayList of items that have 3 Duplicates.
For example, if the ArrayList has the following elements:
elems[0] = "blue"
elems[1] = "red"
elems[2] = "blue"
elems[3] = "green"
elems[4] = "red"
elems[5] = "red"
I want to have a function that goes through the list and then returns a
new arraylist like:
newElems[0] = "red"
newElems[1] = "red"
newElems[2] = "red"
In actuality my arraylist is an array of objects, which have a string
property and I'm referencing like: elems[0].filename = "red"; but the
above example is easier to follow.
I would like to be able to perform this search as fast as possible. I
personally don't have any real experience or familiarity with topics
such as binary trees, etc; would something like that be the route to
take? Thanks.
searching through and comparing the elements of the ArrayList and the
return an ArrayList of items that have 3 Duplicates.
For example, if the ArrayList has the following elements:
elems[0] = "blue"
elems[1] = "red"
elems[2] = "blue"
elems[3] = "green"
elems[4] = "red"
elems[5] = "red"
I want to have a function that goes through the list and then returns a
new arraylist like:
newElems[0] = "red"
newElems[1] = "red"
newElems[2] = "red"
In actuality my arraylist is an array of objects, which have a string
property and I'm referencing like: elems[0].filename = "red"; but the
above example is easier to follow.
I would like to be able to perform this search as fast as possible. I
personally don't have any real experience or familiarity with topics
such as binary trees, etc; would something like that be the route to
take? Thanks.