首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
但求八月九月好运!
亳州职业技术学院
2020届
C++工程师
关注
私信
加入黑名单
举报TA
首页
刷题
圈子
项目
笔记
基本资料
真题试卷
在线编程
心理测试
回答的问题(139)
不同的二叉搜索树
0
class Solution { public: int numTrees(int n) { vector<int>num(n+1); fill(num.begin(),num.end(),0); num[0]=1; ...
发表于 2019-06-03 11:33:02
判断二叉树是否相等
0
class Solution { public: bool isSameTree(TreeNode *p, TreeNode *q) { if(p==nullptr&&q==nullptr) return true; if(p==nullptr...
发表于 2019-05-31 20:06:06
求二叉树的层序遍历
0
class Solution { public: vector<vector<int> > levelOrder(TreeNode *root) { vector<vector<int> >res; if(roo...
发表于 2019-05-31 19:51:08
二叉树的最大深度
0
class Solution { public: int maxDepth(TreeNode *root) { if(root==nullptr) return 0; int llen=maxDepth(root->left); int ...
发表于 2019-05-31 19:38:20
从前序和中序遍历构造二叉树
0
class Solution { public: TreeNode *buildTree(vector<int> &preorder, vector<int> &inorder) { int m=preorder.size(); ...
发表于 2019-05-31 19:34:43
二叉树层序遍历 ii
0
class Solution { public: vector<vector<int> > levelOrderBottom(TreeNode *root) { vector<vector<int> >res; ...
发表于 2019-05-30 18:34:46
将升序数组转化为平衡二叉搜索树
0
class Solution { public: TreeNode *sortedArrayToBST(vector<int> &num) { return CreateTree(num,0,num.size()); } private: ...
发表于 2019-05-30 17:41:31
有序链表变成二叉搜索树
0
class Solution { public: TreeNode *sortedListToBST(ListNode *head) { if(head==nullptr) return nullptr; if(head->next==nullptr) ...
发表于 2019-05-28 20:57:45
合法括号序列判断
0
//这一题题目具有误导性,题目原意就是只要出现不是括号的字符即为非法 class Parenthesis { public: bool ispun(char c) { return c=='('||c==')'; } bool chkParenthes...
发表于 2019-05-27 21:05:48
题目来源于王道论坛 在图B-1所示的平衡二叉树中,插入关键字48后得到一棵新平衡二叉树。在新平衡二叉树中,关键字37所在结点的左、右子结点中保存的关键字分别是()。 图B-1
1
所以这题目是错的,应该是平衡搜索树,而不是平衡二叉树
发表于 2019-05-27 12:18:00
首页
上一页
2
3
4
5
6
7
8
9
下一页
末页
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题