![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 76
nullptr_
技术成就梦想
展开
-
快速排序遇到的问题
好久没有复习一些基础知识了,正好要找实习了,就想复习一下一些基础的算法。想自己把这些简单算法实现一下,没想到首先在快排这儿遇到问题了。刚开始我的快排代码是这样的:void swap(int &a, int &b){ int temp = a; a = b; b = temp;}void QuickSort(int A[], int Left, int Right){ int原创 2014-03-18 22:55:15 · 1686 阅读 · 0 评论 -
A* Pathfinding for Beginners
Updated July 18, 2005This article has been translated into Albanian, Chinese, French, German, Portuguese, Russian, and Spanish. Other translations are welcome. See email address at the bottom转载 2014-07-08 16:20:05 · 501 阅读 · 0 评论 -
输入一个正数n,输出所有和为n 连续正数序列
题目:输入一个正数n,输出所有和为n 连续正数序列原创 2014-07-08 10:52:41 · 2590 阅读 · 0 评论 -
LeetCode__Surrounded Regions
问题描述:Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded region.For example,X X X XX O O XX X原创 2014-05-10 20:33:00 · 390 阅读 · 0 评论 -
LeetCode__Max Points on a Line
题意:是在二维平面上给出一系列点,要求最大的共线的点的数量。首先想到平面上的点共线的定义,即穿过共同点且斜率相同。因此我们可以遍历每个点,找出其他点和这个点构成的直线的斜率,并用一个map记录下这个斜率下的点的数量。注意平面上相同的点要特殊处理。原创 2014-07-07 20:18:09 · 409 阅读 · 0 评论 -
LeetCode_Word Ladder
原题:Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter can be changed at a timeEach intermedia原创 2014-08-01 00:40:31 · 486 阅读 · 0 评论