- 博客(5)
- 收藏
- 关注
原创 C++两个不同类成员之间的调用
/*a.h#include using namespace std; class b; class a { public: b *ib; void putA() { cout<<"This is A Class"<<endl; } };
2014-07-19 16:54:11
2069
原创 LeetCode::Max Points on a Line
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.
2014-06-11 21:01:38
423
原创 LeetCode::Evaluate Reverse Polish Notation
Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another expression. Some examples: ["2", "1",
2014-05-29 23:26:57
535
原创 LeetCode::Reverse Words in a String
#include #include using namespace std; class Solution { public: void reverseWords(string &s) { int i, n; string tmp_s; int word_Length = 0; if(s.empty()) return ; for(i = s.len
2014-05-27 09:14:16
398
原创 算法实现之希尔排序(C++)
希尔排序原理:希尔排序之前的排序算法时间复杂度都是O(n*n),希尔排序算法是突破这个时间复杂度限制的算法之一。 插入排序:由于插入排序所执行的交换操作涉及近邻元素,使得元素每次只能移动一位,所以插入排序的效率较低。比如当关键字最小的元素刚好在数组的尾端,就需要N步将该元素放到数组最前端。而当整个记录本身是基本有序是,只需插入排序的效率是非常高的。 改进方法:让每次交换操作不要涉及近邻元素,通
2014-05-24 10:44:17
511
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人