当前位置:网站首页>Dictionary & lt; T1,T2> Sorting problem
Dictionary & lt; T1,T2> Sorting problem
2022-04-23 07:48:00 【Dake mountain man】

//VoltageCount class ( Quantity corresponding to voltage value ):
public class VoltageCount
{
public Double Voltage { get; set; } // Voltage value
public int CountV { get; set; } // Quantity corresponding to voltage value
public VoltageCount()
{
}
public VoltageCount(Double voltage, int countV)
{
this.Voltage = voltage;
this.CountV = countV;
}
}
Dictionary<Point, VoltageCount> Is the coordinate point ( Use... When drawing images ) And VoltageCount The dictionary corresponding to the data , The purpose is to draw objects (Graphics) Draw the voltage value in - Number of corresponding images ( As shown in the right part of the figure ).
Because you need to sort by quantity and size at the same time , In order to output the table ( As shown in the left two tables , In descending order of quantity ), So here comes the problem of dictionary sorting .
Dictionary<Point, VoltageCount> result = new Dictionary<Point, VoltageCount>();
for (int i = 0; i <= 4; i++){
result.Add(listHeatPoints[i], dictionaryPointVoltageCount[listHeatPoints[i]]);
}
// Sort
.ToDictionary(pair => pair.Key, pair => pair.Value);
版权声明
本文为[Dake mountain man]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230625378868.html
边栏推荐
猜你喜欢

Shapley Explanation Networks

Apache Hudi 如何加速传统的批处理模式?

The page displays the current time in real time

使用flask时代码无报错自动结束,无法保持连接,访问不了url。

Mongodb starts warning information processing

SAP Excel 已完成文件级验证和修复。此工作簿的某些部分可能已被修复或丢弃。

Rethink | open the girl heart mode of station B and explore the design and implementation of APP skin changing mechanism

【NLP笔记】CRF原理初探

利用Lambda表达式解决c#文件名排序问题(是100大还是11大的问题)

SAP PI/PO登录使用及基本功能简介
随机推荐
SAP 03-AMDP CDS Table Function using ‘WITH‘ Clause(Join子查询内容)
js之节点操作,为什么要学习节点操作
SAP Excel 已完成文件级验证和修复。此工作簿的某些部分可能已被修复或丢弃。
基于NLP的软件安全研究(二)
instanceof的实现原理
命令行参数传递库argparse的使用
MySQL storage engine
Hot change scheme and dynamic update strategy of mobile game
斐波拉去动态规划
4. Multi table query
Understanding of STL container
C# SmoothProgressBar自定义进度条控件
反转链表练习
Understanding the Role of Individual Units in a Deep Neural Networks(了解各个卷积核在神经网络中的作用)
Nodejs (VI) sub process operation
面经的总结
ES6 uses recursion to implement deep copy
Double sided shader
SAP SALV14 后台输出SALV数据可直接保存文件,发送Email(带排序、超链接、筛选格式)
ABAP CDS VIEW WITH ASSOCIATION示例