-
Notifications
You must be signed in to change notification settings - Fork 5
searchUnsortedValue
Subhajit Sahu edited this page May 3, 2023
·
1 revision
Find first index of an unsorted value.
Similar: isSorted, hasUnsortedValue, searchUnsortedValue.
function searchUnsortedValue(x, fc, fm)
// x: an array
// fc: compare function (a, b)
// fm: map function (v, i, x)
const xarray = require('extra-array');
// Example for searchUnsortedValue
var x = [1, 2, 3, 4, 5];
xarray.searchUnsortedValue(x);
// → -1
var x = [1, 2, 8, 4, 5];
xarray.searchUnsortedValue(x);
// → 2