原创 我的算法7

題目地址:https://leetcode.com/problems/serialize-and-deserialize-binary-tree/#/description 題目描述:Serialization is the pr

原创 我的算法8

題目地址:https://leetcode.com/problems/binary-tree-postorder-traversal/#/description 題目描述:Given a binary tree, return t

原创 我的算法9

題目地址:https://leetcode.com/problems/binary-tree-maximum-path-sum/#/description 題目描述:Given a binary tree, find the ma

原创 算法作業13

題目地址:https://leetcode.com/problems/remove-duplicate-letters/#/description 題目描述:Given a string which contains only l

原创 算法作業5

題目地址:https://leetcode.com/problems/continuous-subarray-sum/?tab=Description 題目描述:Given a list of non-negative numbe

原创 算法作業12

題目地址:https://leetcode.com/problems/ipo/#/description 題目描述:Suppose LeetCode will start its IPO soon. In order to se

原创 最小樹形圖--朱劉算法

描述:最小樹形圖—-一個有向圖的有根生成樹中權最小的圖。 原理:朱劉算法及相關定理。 代碼 : #include<bits\stdc++.h> using namespace std; typedef int CostT

原创 我的算法6

題目地址:https://leetcode.com/problems/diameter-of-binary-tree/#/description 題目描述:Given a binary tree, you need to comp

原创 dijkstra最短路徑算法

代碼: #include<bits/stdc++.h> using namespace std; #define LEN 100005 #define MAX INT_MAX int n; int node[LEN]; in

原创 最小生成樹kruskal算法

描述:無。 原理:最小生成樹的相關定理。 代碼: #include<bits\stdc++.h> using namespace std; typedef int CostType; class Edge{ public:

原创 dijkstra求最小生成樹

代碼: #include<bits\stdc++.h> using namespace std; #define LEN 1002 #define MAX INT_MAX int edge[LEN][LEN]; int di

原创 算法作業1

題目地址 : https://leetcode.com/problems/median-of-two-sorted-arrays/?tab=Description 題目描述 : There are two sorted arra

原创 算分作業3

題目地址:https://leetcode.com/problems/merge-k-sorted-lists/?tab=Description 題目描述:Merge k sorted linked lists and retu

原创 算法作業4

題目地址:https://leetcode.com/problems/reverse-pairs/?tab=Description 題目描述:Given an array nums, we call (i, j) an impor

原创 flod求最小通路算法

代碼: #include<bits/stdc++.h> using namespace std; #define MAX INT_MAX typedef int CostType; struct Edge{ int