当前位置:网站首页>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
边栏推荐
- How to judge whether a point is within a polygon (including complex polygons or a large number of polygons)
- Ogldev reading notes
- Common DOS commands
- 移动端布局(3D转换、动画)
- MySQL in window10 version does not work after setting remote access permission
- 读取修改resource文件夹下的json文件
- 平面定义-平面方程
- 中间人环境mitmproxy搭建
- SAP SALV14 后台输出SALV数据可直接保存文件,发送Email(带排序、超链接、筛选格式)
- 系统与软件安全研究(五)
猜你喜欢
基于NLP的软件安全研究(二)
Redis connection error err auth < password > called without any password configured for the default user
js之排他思想及案例
int a = 1存放在哪
Dropping Pixels for Adversarial Robustness
平面定义-平面方程
对js中argumens的简单理解
Understanding the Role of Individual Units in a Deep Neural Networks(了解各个卷积核在神经网络中的作用)
Shapley Explanation Networks
利用Lambda表达式解决c#文件名排序问题(是100大还是11大的问题)
随机推荐
State synchronization and frame synchronization
Quick sort
系统与软件安全研究(四)
IDEA快捷键
js之自定义属性以及H5中如何判断自定义属性
踩坑日记:Unable to process Jar entry [module-info.class]
Nodejs (four) character reading
TimelineWindow
.NET 5 的新功能 What‘s new in .NET 5
new的实现
SampleCameraFilter
unity 屏幕自适应
命令行参数传递库argparse的使用
unity UGUI判断点击在UI上和3D物体上的解决方案
05数组的使用
根据某一指定的表名、列名及列值来向前或向后N条查相关列值的SQL自定义标量值函数
自己封装unity的Debug函数
Moment. Format of format method function in JS
C#操作注册表全攻略
Protobuf 使用