English 中文(简体)
Loop Through
原标题:Loop Through a set of Objects

I have a map of key-value pairs of huge size, approximately 10^7, and I have to loop through it 15 times a second in order to update its contents Is there any class or structure that offers good complexity and reduces the time needed to loop through?

目前,我使用的是TreeMap,但复杂程度仅为log n,仅供装、投放、取走。 通过要素进行选择是极其复杂的

你们是否知道任何结构,或是否有什么想法可以减少复杂性below n?

问题回答

如果你不得不任意 entire取全部藏书,你将不胜于零。 如果你必须完成全部收集工作,你可以使用简单的ArrayList,但如果你需要利用钥匙获得收集的具体数据,那么树马普就会被罚款。

如果你的问题只是看一看所有O(n)值,那么你可以按任何顺序(或完全平行)的计算机对O(n)的束缚。

如果你拥有一个完全平行的机器,并取决于你如何重新更新这些要素,你可以加快步伐。 例如,使用《世界人权宣言》和“开放式”或“开放式MP/MPI”和“集群/多核心工作站”,你可以赞扬A[i] = A[i]^3或一些这样的工作速度快。 当然,这会引起通信问题......但可能值得考虑。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签