I am facing a challenge with a sorted array of dates, here is an example:
let arr = ['2019-03-12', '2019-02-11', '2019-02-09', '2018-06-09', '2018-01-24', ..]
The arr
has a length of 100,000, and I need to filter this array using a binary search tree for performance reasons. However, I am unsure how to do this since a binary search tree typically returns an exact value, but I need to return all values that contain "2018", for instance.
Any suggestions on how I can achieve this?