摘要: 查了很久,不太清楚怎么弄 阅读全文
posted @ 2020-10-14 17:54 笨宝宝 阅读(59) 评论(0) 推荐(0) 编辑
摘要: 给定一个二叉树,返回其按层次遍历的节点值。 (即逐层地,从左到右访问所有节点)。 例如: 给定二叉树: [3,9,20,null,null,15,7], public List<List<Integer>> levelOrder(TreeNode root) { Queue<TreeNode> qu 阅读全文
posted @ 2020-02-28 19:41 笨宝宝 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 根据逆波兰表示法,求表达式的值。 有效的运算符包括 +, -, *, / 。每个运算对象可以是整数,也可以是另一个逆波兰表达式。 说明: 整数除法只保留整数部分。 给定逆波兰表达式总是有效的。换句话说,表达式总会得出有效数值且不存在除数为 0 的情况。 来源:力扣(LeetCode)链接:https 阅读全文
posted @ 2020-02-28 17:58 笨宝宝 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效。 有效字符串需满足: 左括号必须用相同类型的右括号闭合。 左括号必须以正确的顺序闭合。 注意空字符串可被认为是有效字符串。 来源:力扣(LeetCode)链接:https://leetcode-cn.com 阅读全文
posted @ 2020-02-28 17:06 笨宝宝 阅读(158) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<vector> using namespace std; //结构定义 #define maxSize 50 typedef struct LinkNode{ int data; struct LinkNode *next; }; typede 阅读全文
posted @ 2020-02-27 16:14 笨宝宝 阅读(143) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<vector> using namespace std; //结构定义 #define maxSize 50 typedef struct{ int data[maxSize]; int rear,prior; }SqQueue; void i 阅读全文
posted @ 2020-02-27 15:03 笨宝宝 阅读(149) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<vector> using namespace std; //结构定义 #define maxSize 50 typedef struct{ int data[maxSize]; int top; }SqStack; void initStac 阅读全文
posted @ 2020-02-27 14:31 笨宝宝 阅读(142) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<vector> using namespace std; //结构定义 #define maxSize 50 typedef struct LNode{ int data; LNode* next; }LNode,*LinkList; //头插 阅读全文
posted @ 2020-02-26 15:39 笨宝宝 阅读(244) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<vector> using namespace std; //结构定义 #define maxSize 50 typedef struct{ int data[maxSize]; int length; }SqList; //插入元素 bool 阅读全文
posted @ 2020-02-26 12:55 笨宝宝 阅读(125) 评论(0) 推荐(0) 编辑
摘要: /* 题目: 链接:https://www.nowcoder.com/questionTerminal/94a4d381a68b47b7a8bed86f2975db46 来源:牛客网 给定一个数组A[0,1,...,n-1],请构建一个数组B[0,1,...,n-1], 其中B中的元素B[i]=A[ 阅读全文
posted @ 2020-01-02 20:20 笨宝宝 阅读(136) 评论(0) 推荐(0) 编辑