How to implement three stacks using a single array

后端 未结 17 774
情书的邮戳
情书的邮戳 2020-12-23 15:10

I came across this problem in an interview website. The problem asks for efficiently implement three stacks in a single array, such that no stack overflows until there is no

17条回答
  •  情歌与酒
    2020-12-23 15:54

    first stack grows at 3n, second stack grows at 3n+1, third grows at 3n+2

    for n={0...N}

提交回复
热议问题