Interleave array in constant space

后端 未结 6 1032
生来不讨喜
生来不讨喜 2020-12-05 14:53

I ran across the following sample job interview question. How can I solve it?

Suppose we have an array a1, a2,... , an, b1, b2, ..., bn.

The goal is to chan

6条回答
  •  猫巷女王i
    2020-12-05 15:06

    If you can transform the array into a linked-list first, the problem becomes trivial.

提交回复
热议问题