restructure and add ipi texs

This commit is contained in:
2019-11-06 18:24:04 +01:00
parent e21da561fc
commit 8fd8d2a485
155 changed files with 129 additions and 0 deletions
@@ -0,0 +1,16 @@
template <class C>
int binsearch (C& a, typename C::value_type x)
{ // returns either index (if found) or -1
int l = 0;
int r = a.size();
while (1) {
int m = (l+r)/2;
if (m==l)
return (a[m]==x) ? m : -1;
if (x<a[m])
r = m;
else
l = m;
}
}