列表结构用法 [英] List structure usage
本文介绍了列表结构用法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
对于哪种类型的问题,您会选择双向链接列表吗?哈希表?
For what types of problems would you choose a doubly-linked list? A hash table?
推荐答案
如果使用合适的结构,我将使用双向链表.最有可能的情况是,我希望以较低的成本在随机位置插入项目,并且不介意为查找对象而进行的高额迭代(根据定义,如果我最有可能只是向前移动或向后按顺序).
哈希表通常用于将一组对象映射到另一组.
I''d use a doubly linked list if that was a suitable structure to use. Most likely if I want to be have a low cost of inserting an item at a random spot, and don''t mind a high cost of iterating to find an object ( and by definition, if I most likely wanted to just move forwards or backwards in order ).
A hash table is typically used to map one set of objects to another.
这篇关于列表结构用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文