摘要: VS低版本打开高版本常会出现的错: The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build 阅读全文
posted @ 2016-11-30 00:05 冯兴伟 阅读(3730) 评论(0) 推荐(0)
摘要: #387. First Unique Character in a String Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, retu 阅读全文
posted @ 2016-11-27 19:20 冯兴伟 阅读(203) 评论(0) 推荐(0)
摘要: #136. Single Number Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a l 阅读全文
posted @ 2016-11-27 18:52 冯兴伟 阅读(200) 评论(0) 推荐(1)
摘要: 常见报错:warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNI 阅读全文
posted @ 2016-11-26 00:09 冯兴伟 阅读(705) 评论(0) 推荐(0)
摘要: 最近点对算法,快速排序,最长公共子序列-动态规划,计数排序,贪心算法阐述,算法时间复杂度分析。 考的不好,有点沮丧。 一 .选择题 计数排序输入序列元素必须是有界非负整数; 递归方法的主要问题是运行效率较低; 可对任何输入序列进行排序的的基于比较的排序的排序方法的最优性能是O(nlogn); 用动态 阅读全文
posted @ 2016-11-23 15:26 冯兴伟 阅读(361) 评论(0) 推荐(0)
摘要: 伪代码: 例子: 阅读全文
posted @ 2016-11-23 01:23 冯兴伟 阅读(1073) 评论(0) 推荐(0)
摘要: Kruskal算法: 不断地选择未被选中的边中权重最轻且不会形成环的一条。 简单的理解: 不停地循环,每一次都寻找两个顶点,这两个顶点不在同一个真子集里,且边上的权值最小。 把找到的这两个顶点联合起来。 初始时,每个顶点各自属于自己的子集合,共n个子集合。 每一步操作,都会将两个子集合融合成一个,进 阅读全文
posted @ 2016-11-23 00:57 冯兴伟 阅读(4665) 评论(0) 推荐(0)
摘要: #441. Arranging Coins You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. Given n, 阅读全文
posted @ 2016-11-22 13:14 冯兴伟 阅读(247) 评论(0) 推荐(0)
摘要: #462. Minimum Moves to Equal Array Elements II Given a non-empty integer array, find the minimum number of moves required to make all array elements e 阅读全文
posted @ 2016-11-22 12:41 冯兴伟 阅读(876) 评论(0) 推荐(0)
摘要: #453. Minimum Moves to Equal Array Elements Given a non-empty integer array of size n, find the minimum number of moves required to make all array ele 阅读全文
posted @ 2016-11-22 12:32 冯兴伟 阅读(588) 评论(0) 推荐(0)
摘要: #27. Remove Element Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for 阅读全文
posted @ 2016-11-21 17:11 冯兴伟 阅读(181) 评论(0) 推荐(0)
摘要: #66. Plus One Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most signific 阅读全文
posted @ 2016-11-21 16:59 冯兴伟 阅读(174) 评论(0) 推荐(0)
摘要: #88. Merge Sorted Array Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume that nums1 h 阅读全文
posted @ 2016-11-21 16:39 冯兴伟 阅读(127) 评论(0) 推荐(0)
摘要: #189. Rotate Array Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [ 阅读全文
posted @ 2016-11-21 15:45 冯兴伟 阅读(902) 评论(0) 推荐(0)
摘要: #217. Contains Duplicate Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears 阅读全文
posted @ 2016-11-21 14:54 冯兴伟 阅读(143) 评论(0) 推荐(0)