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

Dropping Pixels for Adversarial Robustness

ABAP 7.4 SQL Window Expression

int a = 1存放在哪

SAP pi / PO rfc2soap publishes RFC interface as WS example

Django uses MySQL database to solve error reporting

ABAP 从CDS VIEW 发布OData Service示例

King glory - unity learning journey

Simple random roll call lottery (written under JS)

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

SQL针对字符串型数字进行排序
随机推荐
Common DOS commands
ABAP 从CDS VIEW 发布OData Service示例
Solve the problem of deploying mysql8 in docker with correct password but unable to log in to MySQL
The page displays the current time in real time
大学学习路线规划建议贴
Moment. Format of format method function in JS
踩坑日记:Unable to process Jar entry [module-info.class]
MySQL8.0 安装/卸载 教程【Window10版】
ABAP CDS VIEW WITH ASSOCIATION示例
保研准备经验贴——18届(2021年)中南计科推免到浙大工院
SAP DEBUG调试FOR IN、REDUCE等复杂的语句
Mongodb starts warning information processing
NodeJS(一) 事件驱动编程
SAP 导出Excel文件打开显示:“xxx“的文件格式和扩展名不匹配。文件可能已损坏或不安全。除非您信任其来源,否则请勿打开。是否仍要打开它?
中间人环境mitmproxy搭建
int a = 1存放在哪
利用Lambda表达式解决c#文件名排序问题(是100大还是11大的问题)
unity 屏幕自适应
Robust and Efficient Quadrotor Trajectory Generation for Fast Autonomous Flight
ES6使用递归实现深拷贝