阅读背景:

如果数组更易于使用且功能更强大,为什么会使用队列和堆栈等数据结构?

来源:互联网 

This may be a silly question, but it's been bugging me for a while. Most programming languages have arrays (e.g. Java, C/C++, C#...ok Python has lists!) but in much of the literature I see, some data structures (such as stacks and queues) are treated as more basic as arrays. But since so many languages have such great support for arrays, why would anyone use a stack or queue? I realize that conceptually a data structure other than an array may better fit the model, but considering you may have to implement your own stack or queue it's a lot more work considering how fundamental arrays are.This may be a silly question, but it's been bug




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: