当前位置:网站首页>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
边栏推荐
猜你喜欢

Django uses MySQL database to solve error reporting

Use of command line parameter passing library argparse

SAP PI/PO登录使用及基本功能简介

js之排他思想及案例

BTREE, B + tree and hash index

Install and configure Taobao image NPM (cnpm)

Towords Open World Object Detection

Scrapy modifies the time in the statistics at the end of the crawler as the current system time

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

Dropping Pixels for Adversarial Robustness
随机推荐
双面显示的shader
Robust and Efficient Quadrotor Trajectory Generation for Fast Autonomous Flight
取得所有点列表中的最大值GetMaxPoint
Use of command line parameter passing library argparse
Nodejs (VI) sub process operation
大学学习路线规划建议贴
移动Web(字体图标、平面转换、颜色渐变)
Mongodb 启动警告信息处理
SVG中年月日相关的表达式
Unable to process jar entry [module info. Class]
js中对象的三种创建方式
One of event management
MySQL in window10 version does not work after setting remote access permission
Scrapy 修改爬虫结束时统计数据中的时间为当前系统时间
Mongodb starts warning information processing
03Scanner类的使用(控制台输入)
Judge whether the beginning and end of the string contain target parameters: startswith() and endswith() methods
UnityShader基础
SAP DEBUG调试FOR IN、REDUCE等复杂的语句
根据某一指定的表名、列名及列值来向前或向后N条查相关列值的SQL自定义标量值函数