algorithm - how to merge two sorted integer array in place using O(n) time and O(1) space cost -


For example, the position of the beginning of an integer array and its two consecutive sequences, which is 'B1' and 'B2', to

With this the situation is provided with 'last' which indicates the ending status of the second sequence. From array [b1] to array [B2-1] and array [B2] from array [last] in a different order, how do they O (n) time and o (1) space cost

This is not an easy problem, it is possible, but rarely done in practice because the N-scratch This is much more complex than the standard merge using space. Paper has been since the 80's, although the practical implementation did not really come later. Earlier, in 1977, L. Treb-Prado's paper tells Huang and Langstone quite a while ago, but I have been challenged to make that text accurate. Only references are abundant.

An excellent later publication by Geert, Katajainenb, and Pasanen (1995) is a good coverage of multiple algorithms, and Trabb-Prado's contribution in the context topic.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -