本文介绍了数据结构的选择是否会影响勘探过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我试图找出Pex是否发现探索某些数据结构比其他数据结构更难。通过Pfilesystem中的示例代码,主要依赖于列表;我想知道如果我们使用Hashmaps或字典而我们Pex会觉得很难。如果完全使用复杂的数据结构导致探索过程中的困难,你建议应该在Mocking中使用哪些数据结构?I am trying to find if Pex finds it more difficult to explore certain data structures than the others. Going by the example code in Pfilesystem that mostly relies on Lists; I wanted to know if we Pex would find it difficult if we use Hashmaps or dictionaries instead. If at all using complex data-structures causes difficulties in the exploration process, what data-structures do you suggest should be used in Mocking?推荐答案 是。 -           哈希数据结构增加了必须解决的各个路径约束的复杂性(计算和发现哈希码!) - Hashing data-structures add complexity to the individual path constraints that must get solved (computing and discovering hashcodes!) - 相比之下,类似列表的数据结构,通过顺序比较找到单个项目,添加更多指令和个别约束,可能还有更多的运行,但求解的每个约束都可能更简单。 - In comparison, list-like data structures, where individual items are found by sequential comparisons, add more instructions, and individual constraints, and possibly more runs, but each of the constraints to solve is probably simpler. 提示: - 避免散列数据结构,其中键是字符串。它原则上有效,但在实践中非常糟糕。 - Avoid hashing data-structure where the keys are strings. It works in principle, but very badly in practice. -   ; 如果您决定使用散列数据结构,请尽可能定义自己的散列函数,这很简单。避免使用除法和模运算,而是使用位操作操作,在约束求解器上更容易。 - If you decided on using hashing data-structures, define your own hash functions if possible, which are simple. Avoid division and modulo operations in there, and instead use bit-manipulating operations, which are much easier on the constraint solver. 这篇关于数据结构的选择是否会影响勘探过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-21 04:51