Gaan na inhoud

Module:Exponential search: Weergawegeskiedenis

Byskrif: (huidige) = verskil van huidige weergawe, (vorige) = verskil van vorige weergawe, M = klein wysiging

Wys besoekstatistiek

5 Junie 2025

  • huidigevorige 16:2316:23, 5 Junie 2025 Pynappel besprekings bydraes 1 092 grepe +1 092 Nuwe bladsy geskep met '-- 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...'