You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By inserting number 6 to the tableau, the correct result should be
2 3 6 8
4 5 9 14
12 16 inf inf
inf inf inf inf
But your solution gives
2 3 6 8
4 5 9 14
12 inf inf 16
inf inf inf inf
Those elements moved downwards to the next row (e.g., the number 14 and 16 in this example) should be placed in a proper position (in its current row) by comparing with other elements in this row. However, introducing this revision results in an algorithm with a complexity of O(m*n), rather than the required O(m+n).
P.S. In fact I doubt that whether these exists an algorithm with complexity O(m+n).
The text was updated successfully, but these errors were encountered:
CLRS/C06-Heapsort/young.cpp
Line 43 in b7d3df5
Please test with the following example.
The original tableau is
By inserting number
6
to the tableau, the correct result should beBut your solution gives
Those elements moved downwards to the next row (e.g., the number
14
and16
in this example) should be placed in a proper position (in its current row) by comparing with other elements in this row. However, introducing this revision results in an algorithm with a complexity of O(m*n), rather than the required O(m+n).P.S. In fact I doubt that whether these exists an algorithm with complexity O(m+n).
The text was updated successfully, but these errors were encountered: