摘要: https://leetcode.com/problems/increasing-order-search-tree/ Given a tree, rearrange the tree in in-order so that the leftmost node in the tree is now 阅读全文
posted @ 2018-12-10 22:50 丧心病狂工科女 阅读(217) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/power-of-three/ Given an integer, write a function to determine if it is a power of three. Example 1: Example 2: Example 阅读全文
posted @ 2018-12-10 22:30 丧心病狂工科女 阅读(107) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/bulb-switcher/ There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every secon 阅读全文
posted @ 2018-12-10 20:21 丧心病狂工科女 阅读(130) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/binary-tree-inorder-traversal/ Given a binary tree, return the inorder traversal of its nodes' values. Example: 代码: 二叉树 阅读全文
posted @ 2018-12-10 19:51 丧心病狂工科女 阅读(117) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/symmetric-tree/ Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For examp 阅读全文
posted @ 2018-12-10 16:13 丧心病狂工科女 阅读(123) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/search-in-a-binary-search-tree/ Given the root node of a binary search tree (BST) and a value. You need to find the node 阅读全文
posted @ 2018-12-10 15:19 丧心病狂工科女 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 在学习二叉树的过程中按照书上打出来的代码 记下来要经常看看 希望我和我的树玩得开心 :-) ①二叉搜索树的插入删除搜索输出 #include <bits/stdc++.h> using namespace std; struct Node { int key; Node *left, *right, 阅读全文
posted @ 2018-12-10 15:01 丧心病狂工科女 阅读(270) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/maximum-depth-of-binary-tree/ Given a binary tree, find its maximum depth. The maximum depth is the number of nodes alon 阅读全文
posted @ 2018-12-10 14:47 丧心病狂工科女 阅读(111) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/integer-to-roman/ Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is 阅读全文
posted @ 2018-12-10 14:38 丧心病狂工科女 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1091 N-自守数 代码: #include <bits/stdc++.h> using namespace std; int T; int A(int a) { int cnt = 0; while(a) { a /= 10; cnt ++; } return cnt; } int Pow(in 阅读全文
posted @ 2018-12-10 13:20 丧心病狂工科女 阅读(1570) 评论(3) 推荐(1) 编辑