ALGORITHM PRACTICE
文章平均质量分 57
饭团儿在笑
Just a XianYu...
展开
-
SUMMARY OF BASIC ALGORITHMS
TO REVIEW BASIC ALGORITHMS, I DECIDE TO SUMMARIZE THEM BY MYSELF. void insertion_sort(vector<int>&v) { for (int i = 0; i < v.size(); ++i) { int tmp = v[i], j = i; while (j >...原创 2017-07-19 11:34:56 · 261 阅读 · 0 评论 -
1010. Radix (25)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is "yes", if 6 is a decimal number and 110 is a binary number. Now for any pair of positive原创 2017-07-24 13:21:03 · 140 阅读 · 0 评论 -
Longest Common Subsequence.
int lcs(string s1,string s2,int m,int n, vector>&dp){ if(m==0 || n==0) return 0; if(dp[m][n]>0) return dp[m][n]; if(s1[m-1]==s2[n-1]) dp[m]原创 2017-11-14 18:02:07 · 143 阅读 · 0 评论 -
1060. Are They Equal (25)
1060. Are They Equal (25) If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123*105 with simple chopping. No原创 2017-07-18 20:05:54 · 136 阅读 · 0 评论 -
1123. Is It a Complete AVL Tree (30)
1123. Is It a Complete AVL Tree (30) An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they原创 2017-12-08 17:31:40 · 228 阅读 · 0 评论