生活会辜负努力的人,但不会辜负一直努力的人

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
上一页 1 2 3 4 5 6 ··· 14 下一页

2018年11月4日

摘要: 转载:【刷题】二叉树非递归遍历 stack<Node*> st; void preOrder(Node* root) { Node *cur = root; while (cur || !st.empty()) { while (cur) { //访问、入栈、转向左孩子 pre.push_back( 阅读全文
posted @ 2018-11-04 16:49 何许亻也 阅读(207) 评论(0) 推荐(0)

2018年9月25日

摘要: 1、题目描述 Example 1: 2、解题思路: 转载:Herbert_Zero 3、示例代码: 阅读全文
posted @ 2018-09-25 16:08 何许亻也 阅读(202) 评论(0) 推荐(0)

2018年9月16日

摘要: 题目描述 Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are+,-,*,/. Each operand may be an integer or another 阅读全文
posted @ 2018-09-16 16:39 何许亻也 阅读(234) 评论(0) 推荐(0)

摘要: 题目描述 Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the neare 阅读全文
posted @ 2018-09-16 16:04 何许亻也 阅读(197) 评论(0) 推荐(0)

2018年9月14日

摘要: 题目描述 请实现一个函数,将一个字符串中的每个空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。 void replaceSpace(char *str, int length) { int spaceNum = 0; int 阅读全文
posted @ 2018-09-14 22:48 何许亻也 阅读(199) 评论(0) 推荐(0)

摘要: 一、C风格的字符串转化为C++的string对象 C++中,string 类能够自动将C 风格的字符串转换成string 对象 #include <iostream> #include <string> using namespace std; int main() { char str[] = " 阅读全文
posted @ 2018-09-14 19:05 何许亻也 阅读(2791) 评论(0) 推荐(1)

摘要: 题目描述 在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 /* 思路(转自牛客网) * 矩阵是有序的,从左下角来看,向上数字递减,向右数字递增, * 因此 阅读全文
posted @ 2018-09-14 18:43 何许亻也 阅读(182) 评论(0) 推荐(0)

2018年9月7日

摘要: 1、待排序中的元素作数组的下标或map的键值 例题:PAT甲级_1141 PAT Ranking of Institutions 阅读全文
posted @ 2018-09-07 20:16 何许亻也 阅读(896) 评论(0) 推荐(0)

2018年9月5日

摘要: 思路:DFS遍历 阅读全文
posted @ 2018-09-05 10:42 何许亻也 阅读(307) 评论(0) 推荐(0)

2018年8月28日

摘要: 转载https://blog.csdn.net/attitudeisaltitude/article/details/9835785 一、题目:输入一个整数数组,判断该数组是不是某二元查找树的后序遍历的结果。如果是返回true,否则返回false。 思路:在后续遍历得到的序列中,最后一个元素为树的根 阅读全文
posted @ 2018-08-28 15:05 何许亻也 阅读(722) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 ··· 14 下一页