Given an array:
[a_1, a_2, ..., a_N, b_1, b_2, ..., b_N, c_1, c_2, ..., c_N ]
convert it to:
[a_1, b_1, c_1, a_2, b_2, c_2, ..., a_N, b_N, c_N]
in-place using constant extra space.
Refer : http://www.ardendertat.com/2011/10/18/programming-interview-questions-9-convert-array/
http://arxiv.org/PS_cache/arxiv/pdf/0805/0805.1598v1.pdf
[a_1, a_2, ..., a_N, b_1, b_2, ..., b_N, c_1, c_2, ..., c_N ]
convert it to:
[a_1, b_1, c_1, a_2, b_2, c_2, ..., a_N, b_N, c_N]
in-place using constant extra space.
Refer : http://www.ardendertat.com/2011/10/18/programming-interview-questions-9-convert-array/
http://arxiv.org/PS_cache/arxiv/pdf/0805/0805.1598v1.pdf
No comments:
Post a Comment