本文介绍了如何对二维数组排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何对2D数组排序?这似乎不起作用

How can I sort a 2D array? This does not seem to work

for (int j = 0; j < spectrum.spectrum.GetLongLength(1); j++)
                       {
                            double mass = spectrum.spectrum[0, j];
                            double intensity = spectrum.spectrum[1, j];
                            double[] m = new double[2];
                            m[1] = mass;
                            m[0] = intensity;
                            spectrumList[j] = m;

                       }
                       double[][] orderedSpectrum = spectrumList.OrderBy(i => i[0].ToString()).ToArray();

推荐答案


这篇关于如何对二维数组排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-19 03:50