Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es Merge, merge sort?

También llamado: merge (of sorted lists) · merge sort · merge (of sorted sequences)

Definition 27.3 High School Computer Science · Capítulo 27 — Divide and Conquer

To merge two sorted lists is to make one sorted list of all their elements, by repeatedly moving the smaller of their two first elements to the output. Merge sort sorts a list by splitting it into two halves, sorting each by merge sort, and merging the results; a list of 00 or 11 element is already sorted.

One step of merge. The grey elements are already in out, which is sorted and holds the smallest of a and of b. Only a[i] and b[j] are compared: the smaller is the next element.
One step of merge. The grey elements are already in out, which is sorted and holds the smallest of a and of b. Only a[i] and b[j] are compared: the smaller is the next element.
Merge sort on eight numbers: three levels of splitting, then three levels of merging (shaded). Each level of merging handles all eight numbers once.
Merge sort on eight numbers: three levels of splitting, then three levels of merging (shaded). Each level of merging handles all eight numbers once.
Leer en el capítulo →
Definition 19.7 University Computer Science — Year 1 · Capítulo 19 — Sorting

To merge two sorted sequences is to build the sorted sequence of their elements by repeatedly taking the smaller of their two first elements. Merge sort sorts the two halves of an array recursively and merges them.

Leer en el capítulo →