Method SelectNaive
SelectNaive(Int64, Int32)
Naive implementation of Select(Int64, Int32), using NumberOfLeadingZeros(Int64) repetitively. Works relatively fast for low ranks.
Declaration
public static int SelectNaive(long x, int r)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | x | |
System.Int32 | r |
Returns
Type | Description |
---|---|
System.Int32 | The index of the r-th 1 bit in x, or if no such bit exists, 72. |