首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
喜刷刷洗刷刷
东南大学
2018届
Java工程师
找实习~
关注
私信
加入黑名单
举报TA
首页
刷题
圈子
项目
笔记
基本资料
真题试卷
在线编程
心理测试
回答的问题(14)
钓鱼比赛
1
#include <iostream> #include <vector> #include <string> #include <cmath> #include <cstdio> usi...
发表于 2017-03-14 22:00:46
二分查找
1
标准答案 class BinarySearch { public: int getPos(vector<int> A, int n, int val) { int lo = 0, hi = n - 1, mid = 0; while (lo &l...
发表于 2017-03-06 10:50:31
把字符串转换成整数
1
C++ 完美解決 class Solution { public: int StrToInt(string str) { status = Invalid; if (str.empty()) return 0; // skip wh...
发表于 2017-03-03 14:40:18
二叉树的深度
0
class Solution { public: int TreeDepth(TreeNode* pRoot) { if (!pRoot) return 0; return 1 + max(TreeDepth(pRoot->left), TreeDepth(...
发表于 2017-03-02 17:01:26
数字在升序数组中出现的次数
1
C++ 二分查找 简练 class Solution { public: int GetNumberOfK(vector<int> data ,int k) { if (data.empty()) return 0; auto beg = get...
发表于 2017-03-01 16:01:48
把数组排成最小的数
1
活用STL class Solution { public: string PrintMinNumber(vector<int> numbers) { if (numbers.empty()) return ""; sort(...
发表于 2017-02-25 21:08:39
数组中出现次数超过一半的数字
1
C++ 使用HashMap实现 O(N) class Solution { public: int MoreThanHalfNum_Solution(vector<int> numbers) { map<int, size_t> m; ...
发表于 2017-02-25 17:02:01
从上往下打印二叉树
1
class Solution { public: vector<int> PrintFromTopToBottom(TreeNode* root) { vector<int> ret; if (!root) return ret; ...
发表于 2017-02-23 16:42:43
栈的压入、弹出序列
2
参考 @lizo 同学的答案 class Solution { public: bool IsPopOrder(vector<int> pushV, vector<int> popV) { if (pushV.empty() || popV...
发表于 2017-02-23 16:31:08
包含min函数的栈
1
使用一个栈实现 class Solution { public: void push(int value) { if (value < m) { s.push(m); m = value; } ...
发表于 2017-02-23 16:03:04
首页
上一页
1
2
下一页
末页
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题