首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
忆水寒
宁波大学
2017届
C++工程师
颓废躺~
关注
私信
加入黑名单
举报TA
TA的博客
首页
刷题
圈子
项目
笔记
基本资料
真题试卷
在线编程
心理测试
回答的问题(203)
最近公共祖先
0
//画个树,找找规律。 class LCA { public: int getLCA(int a, int b) { // write code here==n if(a==b) return a;//相等,本身就是祖先 int min=(a&...
发表于 2016-08-12 20:16:30
高度最小的BST
0
/*思路1:直接根据公式求。height=log(N)+1; 思路2:建立二叉搜索树(BST),也就知道高度了; 思路3:直接递归求解; */ class MinimalBST { public: int buildMinimalBST(vector<int> vals)...
发表于 2016-08-12 19:45:41
有向路径检查
0
//类似图一样遍历就行,广度优先遍历 class Path { public: bool checkPath(UndirectedGraphNode* a, UndirectedGraphNode* b) { // write code here return...
发表于 2016-08-12 19:31:00
n的阶乘
0
#include<iostream> using namespace std; int main() { int n; while(cin>>n) { long long sum=1; for(int i=1;i<...
发表于 2016-08-12 16:32:53
N阶楼梯上楼问题
1
//注意int型的数据会溢出,定义成long long类型; #include<iostream> using namespace std; long long upper(int N) { if(N<=0) return 0; if(N==1) return ...
发表于 2016-08-12 16:30:42
阶乘
0
#include<iostream> using namespace std; long long JieCheng(int number)//求阶乘 { long long sum=1; for(int i=1;i<=number;i++) sum...
发表于 2016-08-12 16:22:43
八进制
2
#include<iostream> #include<string> using namespace std; void egiht(int number) { if(number<=7) { cout<<number<...
发表于 2016-08-12 16:13:39
回文字符串
0
#include<iostream> #include<string> using namespace std; bool isPstring(string str) { if(str.length()<=1) return true; int beg...
发表于 2016-08-12 16:06:09
a+b
0
#include<iostream> using namespace std; int main() { int a,b; while(cin>>a>>b) { cout<<a+b<<endl; ...
发表于 2016-08-12 15:35:47
中位数
0
#include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { int N; while(cin>>N) { ...
发表于 2016-08-12 15:33:55
首页
上一页
3
4
5
6
7
8
9
10
下一页
末页
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题