07 2020 档案
摘要:解题的过程中有时候,根据题目的要求我们很难去自己实现一种满足题意的数据结构,但是如果我们对STL库比较熟悉的话,可以通过改写里面的一些库函数,从而满足题意的要求。在做题的过程中常见的一些方法主要是对小于号<进行改写。 对set中的<进行改写和对priority_queue中的<进行改写,主要是对这两
阅读全文
摘要:Formation is very important when taking a group photo. Given the rules of forming K rows with N people as the following: The number of people in each
阅读全文
摘要:前序遍历的非递归实现 1 void PreOrder2(BTNode *root) { 2 BTNode *p = root; 3 stack<BTNode *> S; 4 while (p != NULL || !S.empty()) { 5 if (p) { 6 cout << p->val <
阅读全文