binary hunt (bisection) python
is there library duty performs binary hunt list/tuple relapse position vigilant found 'false' (-1, none, etc.) not?
i found functions bisect_left/right , nonetheless still relapse position even vigilant list. that's ideally glorious commanded usage, nonetheless i only wish know an vigilant list (don't wish insert anything).
i guess controlling bisect_left
following checking vigilant during position equal i'm searching, nonetheless seems unwieldy (and i also need finish checking array incomparable largest array list). there nicer slight i'd know it.
edit explain i need for: i'm wakeful collection unequivocally good matched this, nonetheless i'm perplexing keep memory output low possible. commanded use arrange double-way look-up table. i have list list values i need means opening values formed index. also i wish means index sole value zero value list.
using collection fastest way, nonetheless (approximately) double memory requirements.
i seeking doubt pondering i competence have abandoned something python libraries. seems i'll have possess code, moe suggested.
Comments
Post a Comment