- 博客(9)
- 资源 (2)
- 问答 (1)
- 收藏
- 关注

原创 TSP之动态规划找最优解
动态规划解决TSP问题 假设p0,p1,p2...pn-1是从p0到pn-1的最短路径,则p1,p2...pn-1也是最短路径。 pi:点i d(i,v):从i经过点集合v所有点的最短路径长度 c(i,j):从i到j的距离花费 目的:求d(0,v)最短路径和长度 v=空集, d(0,v)=0 v不等于空集,d(0,v)=min{c(0,i)+d(i,v-{i})} i属于v#include <windows.h>#includ...
2020-05-12 17:10:37
995
1

原创 (WPF)自己实现发布订阅管理类,彻底解耦发布者和订阅者
工作中一个项目用到微软的Microsoft.Practices.Prism.PubSubEvents.dll里的发布订阅工具类,实现viewmodel之间的通信,奈何项目升级的时候升级工具不支持这么长名字的dll,我们也知道dll文件的名字和dll程序集名是强关联的,文件名不能随意改变,否则编译可以通过,运行的时候是按程序集名+.dll后缀去寻找dll路径的,必然会导致无法找到引用文件错误。那么没...
2018-08-11 08:24:48
1738
原创 LeetCode.950
public class Solution { public bool HasGroupsSizeX(int[] deck) { Dictionary<int, int> dic = new Dictionary<int, int>(); bool[] visit = new bool...
2018-09-30 17:47:28
364
原创 LeetCode.104. Maximum Depth of Binary Tree
public class Solution { private void TraverseNode(TreeNode node) { if (node == null) { return; } if (node.val > max_dept...
2018-09-14 08:47:33
134
原创 LeetCode.7: Reverse Integer
my answer in CSharp codes:public int Reverse(int x) { string value = x.ToString(); string a = ""; if (value.ElementAt(0).Equals('-')) { ...
2018-09-13 22:37:31
155
原创 LeetCode.872: Leaf-Similar Trees
Two binary trees are considered leaf-similar if their leaf value sequence is the same.Return true if and only if the two given trees with head nodes root1 and root2 are leaf-similar. answer:p...
2018-09-13 21:31:14
127
原创 WPF之DataGrid点击行展开和隐藏行细节
public partial class SourceAllocateReportView : ClientPluginBase { private SourceAllocateReportVM vm = new SourceAllocateReportVM(); public SourceAllocateReportView() { ...
2018-09-05 22:26:36
5700
2
原创 Leetcode.problem1:Two Sum
Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1]. codepublic int[] TwoSum(int[] nums, int target) { List<int> indexList = new L...
2018-08-10 20:00:57
114
原创 Leetcode.problem2:Add Two Numbers
Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1]. code: public ListNode AddTwoNumbers(ListNode l1, ListNode l2){ ListNode newNode = l2; ...
2018-08-10 19:47:15
141
openssl C++开发包(含debug和release,32位和64位都有)
2020-09-27
TSPTest.rar
2020-05-13
TA创建的收藏夹 TA关注的收藏夹
TA关注的人