Like indexOf but returns None instead of -1 if the element is not in the list
Like findIndexOf but returns None instead of -1 if the element is not in the list
Inserts a new element into the sequence after the first element which matches the predicate.
Inserts a new element into the sequence after the first element which matches the predicate. If the predicate isn't matched then the newElement will not be inserted.
function for determining which element to insert after
new element to be added
a new sequence with the element inserted
Finds the median value in an unsorted list in O(n) expected time.
Finds the median value in an unsorted list in O(n) expected time. Will throw if the list is empty.
Finds the median value in an unsorted list in O(n) expected time.
Finds the median value in an unsorted list in O(n) expected time. Does not throw if the list is empty as you probably don't want that.
Finds the nth smallest value in an unsorted list in O(n) time and O(1) space ie List(3,2,4,1).nth(0) => 1 and List(3,2,4,1).nth(2) => 3
Finds the item at the target cumulative weight in an unsorted weighted list in O(n) time.
Returns n randomly selected elements from the given list