¿Fastware?
Fernando Pelliccioni
componentsprogramming.com/
@ferpelliccioni
fpelliccioni@gmail.com
Búsqueda Lineal
Range find(Range, E)(Range r, E e) {
for (; !r.empty; r.popFront) {
if (r.front == e) break;
}
return r;
}
Código en lengu...
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
Versión C++98
...
Estructuras de Datos
Lineales
Estructuras de Datos
Lineales
Estructuras de Datos
Lineales
Estructuras de Datos
Lineales
Rangos
Rangos
Rangos
Rangos
half-open ranges
[first, last)
Rangos
Rangos
Rangos
Rangos
char const s[] = “Hello”;
print(begin(s), end(s));
print(s+1, s+4);
> Hello
> ell
>
s:
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
Búsqueda lineal
H e l l o , _ W o r l d !
$
,element:
range
string s = “Hello, World!”;
auto c = find(begin(s), end(s), ','));
print(c, en...
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
string s = “Hello, World!”;
auto c = find(begin(s), end(s), '?'));
print(c, end(s));
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
template <typename I, typename T>
I find(I f, I l, T const& x) {
while (f != l && *f != x) ++f;
return f;
}
¿Cómo podemos
mejorar el algoritmo?
Búsqueda Lineal
con Centinela
Range find(Range, E)(Range r, E e) {
auto c = r[$ - 1];
r[$ - 1] = e;
size_t i = 0;
{
scope(exit) r[$ - 1] = c;
for (;; ++...
Range find(Range, E)(Range r, E e) {
auto c = r[$ - 1];
r[$ - 1] = e;
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
r[$...
H e l l o , _ W o r l d !
$
,element:
range
string s = “Hello, World!”;
auto r = find(s, ',');
print(r);
Range find(Range, E)(Range r, E e) {
auto c = r[$ - 1];
r[$ - 1] = e;
H e l l o , _ W o r l d !
$
,element:
range
$ - 1
Range find(Range, E)(Range r, E e) {
auto c = r[$ - 1];
r[$ - 1] = e;
H e l l o , _ W o r l d !
$
,element:
range
$ - 1
!c:
Range find(Range, E)(Range r, E e) {
auto c = r[$ - 1];
r[$ - 1] = e;
H e l l o , _ W o r l d ,
$
,element:
range
!c:
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ,
$
,
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ,
$
,
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ,
$
,
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ,
$
,
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ,
$
,
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ,
$
,
=
...
Range find(Range, E)(Range r, E e) {
...
r[$ - 1] = c;
if (i + 1 == r.length && c != e)
++i;
return r[i .. $];
}
H e l l o...
string s = “Hello, World!”;
auto r = find(s, '?');
print(r);
Range find(Range, E)(Range r, E e) {
auto c = r[$ - 1];
r[$ - 1] = e;
H e l l o , _ W o r l d !
$
?element:
range
$ - 1
Range find(Range, E)(Range r, E e) {
auto c = r[$ - 1];
r[$ - 1] = e;
H e l l o , _ W o r l d !
$
?element:
range
$ - 1
!c:
Range find(Range, E)(Range r, E e) {
auto c = r[$ - 1];
r[$ - 1] = e;
H e l l o , _ W o r l d ?
$
?element:
range
!c:
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ?
$
?
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d
$
?
=
ra...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ?
$
?
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ?
$
?
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ?
$
?
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ?
$
?
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ?
$
?
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ?
$
?
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ?
$
?
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ?
$
?
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ?
$
?
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ?
$
?
=
...
Range find(Range, E)(Range r, E e) {
...
size_t i = 0;
for (;; ++i)
if (r[i] == e) break;
H e l l o , _ W o r l d ?
$
?
=
...
Range find(Range, E)(Range r, E e) {
...
r[$ - 1] = c;
if (i + 1 == r.length && c != e)
++i;
return r[i .. $];
}
H e l l o...
Range find(Range, E)(Range r, E e) {
...
r[$ - 1] = c;
if (i + 1 == r.length && c != e)
++i;
return r[i .. $];
}
H e l l o...
Range find(Range, E)(Range r, E e) {
...
r[$ - 1] = c;
if (i + 1 == r.length && c != e)
++i;
return r[i .. $];
}
H e l l o...
¿Qué imprime?
int[] a = [1, 2, 3, 4];
auto r = find(a, 3);
print(r);
int[] a = [1, 2, 3, 4];
auto r = find(a, 3);
print(r);
> [3, 4]
>
Todo muy lindo, ¿no?
¿Qué imprime?
int[] a = [];
auto r = find(a, 3);
print(r);
int[] a = [];
auto r = find(a, 3);
print(r);
> core.exception.RangeError@alexandrescu.d(27):
Range violation
>
Range find(Range, E)(Range r, E e) {
auto c = r[$ - 1];
r[$ - 1] = e;
...
}
Range find(Range, E)(Range r, E e) {
auto c = r[$ - 1]; <<<<<<<<<
r[$ - 1] = e;
...
}
¿Qué imprime?
Usando find() sin Centinela
string s = “Hello, World!”;
auto r = find(s, 'W');
print(r);
> World!
>
string s = “Hello, World!”;
auto r = find(s, 'W');
print(r);
¿Qué imprime?
Usando find() con Centinela
string s = “Hello, World!”;
auto r = find(s, 'W');
print(r);
> World!
>
string s = “Hello, World!”;
auto r = find(s, 'W');
print(r);
¿?
> World!
> o, World!
> W, World!
> Xorld!
> X?%$j!
>
Para poder usar
el find() con
Centinela de forma
segura, tengo que
usar mecanismos de
sincronización de Threads
(Mutexes)
Entonces, ¿Es últil
el algoritmo de
búsqueda lineal
con Centinela?
Sí,es útil.
El problema con la
implementación de Andrei
es que está cambiando
la semántica
de un algoritmo conocido,
donde...
Conclusión: Especificar y usar
nombres correctos.
En la próxima charla veremos
como implementarla correctamente
en C++ usa...
¡Gracias!
Fernando Pelliccioni
componentsprogramming.com/
@ferpelliccioni
fpelliccioni@gmail.com
- Video:
https://www.youtube.com/watch?v=AxnotgLql0k
- Filminas:
http://www.slideshare.net/AndreiAlexandrescu2/accu-keynot...
¿Fastware?
¿Fastware?
¿Fastware?
¿Fastware?
¿Fastware?
¿Fastware?
¿Fastware?
Próxima SlideShare
Cargando en…5
×

¿Fastware?

98 visualizaciones

Publicado el

Presentación en el Segundo Encuentro de programadores C++ de Buenos Aires

Publicado en: Ciencias
0 comentarios
0 recomendaciones
Estadísticas
Notas
  • Sé el primero en comentar

  • Sé el primero en recomendar esto

Sin descargas
Visualizaciones
Visualizaciones totales
98
En SlideShare
0
De insertados
0
Número de insertados
1
Acciones
Compartido
0
Descargas
2
Comentarios
0
Recomendaciones
0
Insertados 0
No insertados

No hay notas en la diapositiva.

¿Fastware?

  1. 1. ¿Fastware? Fernando Pelliccioni componentsprogramming.com/ @ferpelliccioni fpelliccioni@gmail.com
  2. 2. Búsqueda Lineal
  3. 3. Range find(Range, E)(Range r, E e) { for (; !r.empty; r.popFront) { if (r.front == e) break; } return r; } Código en lenguaje de programación D. ¡Perdón!
  4. 4. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; } Versión C++98 (sin especificaciones)
  5. 5. Estructuras de Datos Lineales
  6. 6. Estructuras de Datos Lineales
  7. 7. Estructuras de Datos Lineales
  8. 8. Estructuras de Datos Lineales
  9. 9. Rangos
  10. 10. Rangos
  11. 11. Rangos
  12. 12. Rangos half-open ranges [first, last)
  13. 13. Rangos
  14. 14. Rangos
  15. 15. Rangos
  16. 16. Rangos char const s[] = “Hello”; print(begin(s), end(s)); print(s+1, s+4); > Hello > ell > s:
  17. 17. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; } Búsqueda lineal
  18. 18. H e l l o , _ W o r l d ! $ ,element: range string s = “Hello, World!”; auto c = find(begin(s), end(s), ',')); print(c, end(s));
  19. 19. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  20. 20. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  21. 21. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  22. 22. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  23. 23. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  24. 24. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  25. 25. string s = “Hello, World!”; auto c = find(begin(s), end(s), '?')); print(c, end(s));
  26. 26. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  27. 27. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  28. 28. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  29. 29. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  30. 30. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  31. 31. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  32. 32. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  33. 33. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  34. 34. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  35. 35. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  36. 36. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  37. 37. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  38. 38. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  39. 39. template <typename I, typename T> I find(I f, I l, T const& x) { while (f != l && *f != x) ++f; return f; }
  40. 40. ¿Cómo podemos mejorar el algoritmo?
  41. 41. Búsqueda Lineal con Centinela
  42. 42. Range find(Range, E)(Range r, E e) { auto c = r[$ - 1]; r[$ - 1] = e; size_t i = 0; { scope(exit) r[$ - 1] = c; for (;; ++i) if (r[i] == e) break; } if (i + 1 == r.length && c != e) ++i; return r[i .. $]; }
  43. 43. Range find(Range, E)(Range r, E e) { auto c = r[$ - 1]; r[$ - 1] = e; size_t i = 0; for (;; ++i) if (r[i] == e) break; r[$ - 1] = c; if (i + 1 == r.length && c != e) ++i; return r[i .. $]; }
  44. 44. H e l l o , _ W o r l d ! $ ,element: range string s = “Hello, World!”; auto r = find(s, ','); print(r);
  45. 45. Range find(Range, E)(Range r, E e) { auto c = r[$ - 1]; r[$ - 1] = e; H e l l o , _ W o r l d ! $ ,element: range $ - 1
  46. 46. Range find(Range, E)(Range r, E e) { auto c = r[$ - 1]; r[$ - 1] = e; H e l l o , _ W o r l d ! $ ,element: range $ - 1 !c:
  47. 47. Range find(Range, E)(Range r, E e) { auto c = r[$ - 1]; r[$ - 1] = e; H e l l o , _ W o r l d , $ ,element: range !c:
  48. 48. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d , $ , = range
  49. 49. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d , $ , = range
  50. 50. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d , $ , = range
  51. 51. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d , $ , = range
  52. 52. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d , $ , = range
  53. 53. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d , $ , = range
  54. 54. Range find(Range, E)(Range r, E e) { ... r[$ - 1] = c; if (i + 1 == r.length && c != e) ++i; return r[i .. $]; } H e l l o , _ W o r l d ! $ $ - 1 !c: range
  55. 55. string s = “Hello, World!”; auto r = find(s, '?'); print(r);
  56. 56. Range find(Range, E)(Range r, E e) { auto c = r[$ - 1]; r[$ - 1] = e; H e l l o , _ W o r l d ! $ ?element: range $ - 1
  57. 57. Range find(Range, E)(Range r, E e) { auto c = r[$ - 1]; r[$ - 1] = e; H e l l o , _ W o r l d ! $ ?element: range $ - 1 !c:
  58. 58. Range find(Range, E)(Range r, E e) { auto c = r[$ - 1]; r[$ - 1] = e; H e l l o , _ W o r l d ? $ ?element: range !c:
  59. 59. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d ? $ ? = range
  60. 60. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d $ ? = range
  61. 61. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d ? $ ? = range
  62. 62. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d ? $ ? = range
  63. 63. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d ? $ ? = range
  64. 64. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d ? $ ? = range
  65. 65. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d ? $ ? = range
  66. 66. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d ? $ ? = range
  67. 67. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d ? $ ? = range
  68. 68. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d ? $ ? = range
  69. 69. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d ? $ ? = range
  70. 70. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d ? $ ? = range
  71. 71. Range find(Range, E)(Range r, E e) { ... size_t i = 0; for (;; ++i) if (r[i] == e) break; H e l l o , _ W o r l d ? $ ? = range
  72. 72. Range find(Range, E)(Range r, E e) { ... r[$ - 1] = c; if (i + 1 == r.length && c != e) ++i; return r[i .. $]; } H e l l o , _ W o r l d ! $ $ - 1 !c: range ?element:
  73. 73. Range find(Range, E)(Range r, E e) { ... r[$ - 1] = c; if (i + 1 == r.length && c != e) ++i; return r[i .. $]; } H e l l o , _ W o r l d ! $ ? = range
  74. 74. Range find(Range, E)(Range r, E e) { ... r[$ - 1] = c; if (i + 1 == r.length && c != e) ++i; return r[i .. $]; } H e l l o , _ W o r l d ! $ range
  75. 75. ¿Qué imprime? int[] a = [1, 2, 3, 4]; auto r = find(a, 3); print(r);
  76. 76. int[] a = [1, 2, 3, 4]; auto r = find(a, 3); print(r); > [3, 4] >
  77. 77. Todo muy lindo, ¿no?
  78. 78. ¿Qué imprime? int[] a = []; auto r = find(a, 3); print(r);
  79. 79. int[] a = []; auto r = find(a, 3); print(r); > core.exception.RangeError@alexandrescu.d(27): Range violation >
  80. 80. Range find(Range, E)(Range r, E e) { auto c = r[$ - 1]; r[$ - 1] = e; ... }
  81. 81. Range find(Range, E)(Range r, E e) { auto c = r[$ - 1]; <<<<<<<<< r[$ - 1] = e; ... }
  82. 82. ¿Qué imprime? Usando find() sin Centinela string s = “Hello, World!”; auto r = find(s, 'W'); print(r);
  83. 83. > World! > string s = “Hello, World!”; auto r = find(s, 'W'); print(r);
  84. 84. ¿Qué imprime? Usando find() con Centinela string s = “Hello, World!”; auto r = find(s, 'W'); print(r);
  85. 85. > World! > string s = “Hello, World!”; auto r = find(s, 'W'); print(r); ¿?
  86. 86. > World! > o, World! > W, World! > Xorld! > X?%$j! >
  87. 87. Para poder usar el find() con Centinela de forma segura, tengo que usar mecanismos de sincronización de Threads (Mutexes)
  88. 88. Entonces, ¿Es últil el algoritmo de búsqueda lineal con Centinela?
  89. 89. Sí,es útil. El problema con la implementación de Andrei es que está cambiando la semántica de un algoritmo conocido, donde uno no espera que se modifiquen datos.
  90. 90. Conclusión: Especificar y usar nombres correctos. En la próxima charla veremos como implementarla correctamente en C++ usando Concepts.
  91. 91. ¡Gracias! Fernando Pelliccioni componentsprogramming.com/ @ferpelliccioni fpelliccioni@gmail.com
  92. 92. - Video: https://www.youtube.com/watch?v=AxnotgLql0k - Filminas: http://www.slideshare.net/AndreiAlexandrescu2/accu-keynote-by-andrei-alexandrescu - Donald Knuth llama a los centinelas "dummy records" y los usa en su Algorithm Q (Quick sequential search) The Art of Computer Programming, Vol. 3 "Sorting and Searching", 2nd Edition, Chapter 6.1 "Sequential Searching". Referencias:

×