在STL中list是以双向链表的方式来存储的,应此使用给定的下标值来找到对应的节点所需的时间复杂度为O(n),相比vector直接使用原生指针会慢一些。因为是双向链表的关系,那么必然有一种结构来表示链表中的节点。Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> template<typenameT>struct__list_node{__list_node<T>*prev;__list_node<T>*ne Read More
posted @ 2012-08-09 21:23 lwch Views(1624) Comments(0) Diggs(0) Edit