摘要:
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. /** * Definition for a point. * struct Point { * i 阅读全文
摘要:
请设计一个函数,用来判断在一个矩阵中是否存在一条包含某字符串所有字符的路径。路径可以从矩阵中的任意一个格子开始,每一步可以在矩阵中向左,向右,向上,向下移动一个格子。如果一条路径经过了矩阵中的某一个格子,则该路径不能再进入该格子。 例如 a b c e s f c s a d e e 矩阵中包含一条 阅读全文
摘要:
class Solution {public: int Add(int num1, int num2) { while(num2!=0) { int tmp=num1^num2;//得到相加以后没有进位的数 num2=(num1&num2)<<1;//进位 num1=tmp; } return nu 阅读全文
摘要:
#include<iostream> using namespace std;template<class T>class SqQueue{ protected: int front,rear; int maxSize; T *elem; public: SqQueue(int size); ~Sq 阅读全文
摘要:
#include<iostream> template<class T>class SqStack{protected: int count; int maxSize; T *elem;public: SqStack(int size); ~SqStack(); int Length(){ retu 阅读全文
摘要:
#include<iostream>using namespace std;template<typename T>class SqList{private: int count;//实际元素个数 int Maxsize;//数组最大长度 T *elem;public: SqList(int siz 阅读全文