LinkedList问题 [英] LinkedList question
问题描述
你好!
以下情况:
我有一个具有10000个成员对象的LinkedList<temp>
.
结构Temp
由字段Max
,Min
,Avg
和其他一些字段组成.
在某些时候,我需要取出max,min,avg的全部信息,并将其存储在单个维度数组中,例如:Double[] min
.
目前,我正在考虑copyTo temp[]
,然后使用for循环提取最小值,最大值并将它们存储到数组中.但这感觉不对,我一直在想有一种更简单的方法.
有没有更简单的方法?
有最小和最大方法可供您使用
>
Hello!
following situation:
I have a LinkedList<temp>
with 10000 member objects.
Struct Temp
consists of fields Max
, Min
, Avg
and some other.
At some points I need the whole information of max, min, avg taken out and stored in a single dimension array ex: Double[] min
.
Currently I''m thinking of copyTo temp[]
and then use for loop to extract the min, max and store them to their arrays. But this feels wrong and I keep thinking that theres a easier way.
Is there an easier way?
there is min and max method which you can use
这篇关于LinkedList问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!