开发者

Implementing 3 stacks in one Array using C++

Was wondering how this can be done using C开发者_运维技巧++.

Divide given array into 3 parts - (0 - N/3), (N/3 - 2N/3) , (2N/3 - N). How would i keep track of the overflow?

Thanks Kelly


You must necessarily maintain a pointer-to-top for each of your stacks. Why not just check that these pointers don't exceed their bounds?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜