我也提出了其他一些想法: 1.现在地图上有各自约12个单词的对象。我可以将存储指针,以便额外的未使用节点更小。 不幸的是,节点的大小仍然与其分开 数据至少增加几个字,并且管理原始指针可能是痛苦的。 2.而不是每个边缘有一个地图我比方说,每个 多边形可以有一个地图,并使用更复杂的排序来保持所有中间的点数。这似乎也是一种痛苦,它打破了边缘 抽象,并且在一个更大的结构中进行搜索会产生效率损失。 我认为我会满意,至少暂时的,结构是 支持线性时间搜索和恒定时间插入。这表明 一个列表,除了列表实现还在第一个元素之后以 32的块分配。从正面看,与列表节点相比,与列表节点相关联的开销较少 。 所有这些都令人惊讶,当我停下来思考哲学时,为什么 S(标准)TL并没有更加标准化。I''ve come up with a couple other ideas too:1. Right now the map holds objects which are about 12 words each. Icould store pointers instead so that the extra unused nodes are smaller.Unfortunately there''s still the size of the node separate from itsdata which adds a few words at least, and managing raw pointers can be apain.2. Rather than have one map per edge I could have, say, one map perpolygon and use a more complicated sort to keep all the intermediatepoints straight. This also seems like a pain, it breaks the edgeabstraction, and there''s an efficiency penalty from searching in alarger structure.I think I''d be satisfied, at least provisionally, with a structure thatsupports linear time searches and constant time inserts. This suggestsa list except that the list implementation also allocates in blocks of32 after the first element. On the plus side there''s less overheadassociated with the nodes of a list compared to those of a map.All of which makes wonder, as I pause to wax philosophical, why theS(tandard)TL isn''t more standardized. 这篇关于如何处理与平台相关的问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-06 02:58