Module:Exponential search: Revision history

Jump to navigation Jump to search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

(newest | oldest) View ( | older 50) (20 | 50 | 100 | 250 | 500)

12 June 2023

28 May 2023

  • curprev 21:1621:16, 28 May 2023Penguinplushie talk contribs 1,092 bytes +1,092 Created page with "-- This module provides a generic exponential search algorithm. requirestrict local checkType = require('libraryUtil').checkType local floor = math.floor local function midPoint(lower, upper) return floor(lower + (upper - lower) / 2) end local function search(testFunc, i, lower, upper) if testFunc(i) then if i + 1 == upper then return i end lower = i if upper then i = midPoint(lower, upper) else i = i * 2 end return search(testFunc, i, low..."
(newest | oldest) View ( | older 50) (20 | 50 | 100 | 250 | 500)