首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
Joe_liu
中国科学院上海微系统与信息技术研究所
2016届
C++工程师
关注
私信
加入黑名单
举报TA
首页
刷题
圈子
项目
笔记
基本资料
真题试卷
在线编程
心理测试
回答的问题(21)
输出单层结点
3
//层序遍历找到深度指向的层数,将其val存入链表 class TreeLevel { public: ListNode* getTreeLevel(TreeNode* root, int dep) { // write code here ListNode *pRoot = new Li...
发表于 2015-09-29 16:25:06
检查是否为BST
2
//非递归遍历二叉树,然后判断结果是否递增 class Checker { public: bool checkBST(TreeNode* root) { // write code here stack<TreeNode*> s; TreeNode *pNode = ro...
发表于 2015-09-29 15:11:59
翻转子串
1
class ReverseEqual { public: //将两个s1连接起来,判断s2是否为s1的子串,利用string的find来实现 bool checkReverseEqual(string s1, string s2) { // write code here int L1 ...
发表于 2015-09-19 16:08:50
按之字形顺序打印二叉树
1
/* 按照层序遍历,添加一个计数,在奇数层反向存储 */ class Solution { public: vector<vector<int> > Print(TreeNode* pRoot) { vector<vector<int>> ret...
发表于 2015-09-19 15:53:19
链表中环的入口结点
0
class Solution { public: ListNode* EntryNodeOfLoop(ListNode* pHead) { if (pHead == NULL) return NULL; ListNode *pFast = pHead; ListNode *pS...
发表于 2015-09-01 15:53:44
正则表达式匹配
1
class Solution { public: bool match(string str, string pattern) { char a[100],b[100]; strcpy(a,str.c_str()); strcpy(b,pattern....
发表于 2015-09-01 15:32:10
孩子们的游戏(圆圈中最后剩下的数)
1
class Solution { public: int LastRemaining_Solution(unsigned int n, unsigned int m) { if (n < 1 || m < 1) return -1; unsigned int i = 0...
发表于 2015-09-01 12:51:55
不用加减乘除做加法
4
class Solution { public: int Add(int num1, int num2) { int Sum, Carry; do { Sum = num2 ^ num1; Carry = (num1 & num2) << 1; ...
发表于 2015-09-01 11:20:04
扑克牌顺子
0
//统计0的个数以及是否有除0之外的相同的数 //再根据非0元素下表与元素差的关系来判断 class Solution { public: bool IsContinuous(vector<int> numbers) { if (numbers.size() != 5) re...
发表于 2015-09-01 11:06:09
翻转单词序列
1
class Solution { public: string ReverseSentence(string str) { string Ret; vector<int> index; if (str.size() <= 0) return Ret; int...
发表于 2015-09-01 09:45:30
首页
上一页
1
2
3
下一页
末页
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题