LinkedList问题 [英] LinkedList question

查看:91
本文介绍了LinkedList问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!

以下情况:

我有一个具有10000个成员对象的LinkedList<temp>.

结构Temp由字段MaxMinAvg和其他一些字段组成.

在某些时候,我需要取出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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆