K wobsahej skočić

Stawizny wersijow strony „Modul:Exponential search“

Diff wubrać: Wubjer opciske pola za přirunanje a tłóč na enter abo tłóčku deleka.

Legenda: (akt) = rozdźěl k tuchwilnej wersiji, (posl) = rozdźěl k předchadnej wersiji, S = snadna změna.


Eksterne wotkazy: Statistika wopytow

31. měrca 2025

  • aktposl 12:4331. měrca 2025, 12:43 119.207.115.159 diskusija 1.074 bajtow +1.074 nowa strona: -- This module provides a generic exponential search algorithm. 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, lower, upper) else upper…
Z Wikipedije, swobodneje encyklopedije