master > master: code go - messages verbessert
This commit is contained in:
@@ -38,15 +38,14 @@ func InterpolationSearch(L []int, x int, u int, v int) int {
|
||||
}
|
||||
metrics.AddTimeCost()
|
||||
p := getSuchposition(L, x, u, v)
|
||||
logging.Debug("Interpolante von x in (u, v)=(%[1]v, %[2]v) ist p = %[3]v.", u, v, p)
|
||||
if L[p] == x {
|
||||
logging.Debug("x in Position p gefunden")
|
||||
logging.Debug("Interpolante in (%[1]v, %[2]v) ist p = %[3]v; L[p] == x; ===> Element gefunden", u, v, p)
|
||||
return p
|
||||
} else if x < L[p] {
|
||||
logging.Debug("Suche in linker Hälfte fortsetzen.")
|
||||
logging.Debug("Interpolante in (%[1]v, %[2]v) ist p = %[3]v; L[p] > x; ===> suche in linker Hälfte", u, v, p)
|
||||
return InterpolationSearch(L, x, u, p-1)
|
||||
} else { // } else if x > L[p] {
|
||||
logging.Debug("Suche in rechter Hälfte fortsetzen.")
|
||||
logging.Debug("Interpolante in (%[1]v, %[2]v) ist p = %[3]v; L[p] < x; ===> suche in rechter Hälfte", u, v, p)
|
||||
return InterpolationSearch(L, x, p+1, v)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user