Returns the index at which key would be inserted into list, sorted ascending by comparator
(natural order when omitted), to keep it sorted: the least index whose element does not compare
less than key, or list.size when every element does. The result on an unsorted list is
unspecified.
Time: at most ⌈log₂(n + 1)⌉ comparator calls and as many get calls.
Returns the index at which
keywould be inserted intolist, sorted ascending bycomparator(natural order when omitted), to keep it sorted: the least index whose element does not compare less thankey, orlist.sizewhen every element does. The result on an unsorted list is unspecified.Time: at most ⌈log₂(n + 1)⌉ comparator calls and as many
getcalls.