摘要:#include<iostream>#include<algorithm>#include<string>#include<stdlib.h>#include<cmath>using namespace std;int main(){ string str1, str2; string shortS
阅读全文
09 2017 档案
摘要:#include<iostream>#include<stdlib.h>#include<malloc.h>#include<algorithm> #include<ctime>#define length 10using namespace std;bool compare(int a, int
阅读全文
摘要:其中,最重要的是,sequence一开始如果它的值为空的话,它是要返回false。但是之后,只要sizex小于3都应该返回true class Solution {public: bool VerifySquenceOfBST(vector<int> sequence) { if (sequence
阅读全文
摘要:主要思想栈必须满足先进后出的规则,例如: 压入序列1,2,3,4,5 出栈序列4,3,5,1,2 设定一个Max值代表目前已经出栈的压入序列索引号最大的值 如当4出栈的时候,目前Max是4,当3出栈的时候,就查看3,4是否出栈,如果出栈就正确 当1出栈的时候,目前Max是5,就查看1~5时候出栈,这
阅读全文
摘要:两种方法的思路都是一致的,都是把一个二维矩阵看作一圈一圈的进行打印。 输入:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 输出:1,2,3,4,8,12,16,15,14,13,9,5,6,7,11,10 第一种方式还不能成功运行,需要后续补充,也比第二种方法更麻烦一
阅读全文