问题 D: 4.5.17 Power Strings 题目描述 Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = ...
分类:
其他好文 时间:
2019-06-25 15:08:41
阅读次数:
123
利用不同的端口,实现目的准备工作:准备两个网页放在两个不同的文件夹下如:创建网站ONE默认为80端口修改默认文档用相同的方法创建TWO网页(端口号改为666,或者其他)访问方法访问TWO网页需要加上端口号,如:
分类:
Web程序 时间:
2019-06-25 10:25:59
阅读次数:
131
一 . 最长子序列和 令dp[i] 为以i结尾的最长子序列和。dp[i] = max(dp[i-1] + nums[i], nums[i])。 同时纪录dp[i]遍历结果的中的最大值。需要三个变量,纪录上一个dp, 当前dp和最大的dp. 二. House RobberI 只有dp(n) = max ...
分类:
编程语言 时间:
2019-06-25 00:17:16
阅读次数:
117
CCA算法实现和优化 [TOC] 基本思路是两种,一种是dfs,另一种是并查集(two pass)。先考虑并查集的做法,不优化和优化,在大图(1280 720,~3000个CCA)上,速度相差巨大: 30s 4ms (提升接近8000倍) 。 代码框架 基于并查集的实现与优化 0. 最naive的并 ...
分类:
编程语言 时间:
2019-06-24 17:05:30
阅读次数:
145
Source: PAT A1066 Root of AVL Tree (25 分) Description: An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two chil ...
分类:
其他好文 时间:
2019-06-24 16:24:26
阅读次数:
91
传送门 D. Divide by three, multiply by two ?题意 给你一个数 x,有以下两种操作,x 可以任选其中一种操作得到数 y 1.如果x可以被3整除,y=x/3 2.y=x*2 y 再执行上述两种操作的一种得到数 z; 接着对 z 得到...... 这样依次执行了 n- ...
分类:
其他好文 时间:
2019-06-24 12:32:15
阅读次数:
80
problem 617. Merge Two Binary Trees 参考 1. Leetcode_easy_617. Merge Two Binary Trees; 完 完 ...
分类:
其他好文 时间:
2019-06-24 12:25:05
阅读次数:
72
第二周。 1.Algorithm:每周至少做一个 leetcode 的算法题2.Review:阅读并点评至少一篇英文技术文章3.Tip:学习至少一个技术技巧4.Share:分享一篇有观点和思考的技术文章 以下是各项的情况: Algorithm 链接:[LeetCode-01]-Two Sum 上周的 ...
分类:
其他好文 时间:
2019-06-24 09:26:03
阅读次数:
82
题目给定两个大小为 m 和 n 的有序数组nums1和 nums2。 请你找出这两个有序数组的中位数,并且要求算法的时间复杂度为 O(log(m + n))。 你可以假设 nums1 和 nums2 不会同时为空。 示例 1: nums1 = [1, 3]nums2 = [2] 则中位数是 2.01 ...
分类:
编程语言 时间:
2019-06-23 14:17:44
阅读次数:
108
1029 Median (25 分) 1029 Median (25 分) 1029 Median (25 分) Given an increasing sequence S of N integers, the median is the number at the middle position ...
分类:
其他好文 时间:
2019-06-23 01:29:05
阅读次数:
123