master > master: code, go - bugs behoben (out of bounds + Konversion fand nicht statt)
This commit is contained in:
@@ -38,6 +38,9 @@ func JumpSearchLinear(L []int, x int, m int) int {
|
||||
// ACHTUNG: dies ist eine while-Schleife ist golang:
|
||||
for i0 < len(L) {
|
||||
metrics.AddTimeCost()
|
||||
if i1 > len(L) {
|
||||
i1 = len(L)
|
||||
}
|
||||
block := L[i0:i1]
|
||||
elementAfterBlock := block[len(block)-1] + 1
|
||||
if x < elementAfterBlock {
|
||||
@@ -74,6 +77,9 @@ func JumpSearchExponentiell(L []int, x int) int {
|
||||
// ACHTUNG: dies ist eine while-Schleife ist golang:
|
||||
for i0 < len(L) {
|
||||
metrics.AddTimeCost()
|
||||
if i1 > len(L) {
|
||||
i1 = len(L)
|
||||
}
|
||||
block := L[i0:i1]
|
||||
elementAfterBlock := block[len(block)-1] + 1
|
||||
if x < elementAfterBlock {
|
||||
|
||||
Reference in New Issue
Block a user