
剑指offer
文章平均质量分 73
lengshien
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
剑指offer 第八题 二叉树的下一个节点
#include using namespace std; struct BinaryTreeNode { int m_nValue; BinaryTreeNode* m_pLeft; BinaryTreeNode* m_pRight; BinaryTreeNode* m_pParent; }; BinaryTreeNode* GetNext(BinaryTre原创 2017-05-16 09:07:47 · 511 阅读 · 0 评论 -
根据二叉树的前序和中序建树
#ifndef BINARYTREE_H #define BINARYTREE_H #include struct BinaryTreeNode { int m_nValue; BinaryTreeNode* m_nLeft; BinaryTreeNode* m_nRight; }; BinaryTreeNode* CreatBinaryTre原创 2017-05-13 16:12:48 · 635 阅读 · 0 评论 -
剑指offer--面试题53 在排序数组中查找数字(二分)
//数字在排序数组中出现的次数 #include using namespace std; int GetFirstK(const int* data,int length,int k,int start,int end); int GetLastK(const int* data,int length,int k,int start,int end); int GetNumberOfK原创 2017-05-12 09:10:05 · 530 阅读 · 0 评论 -
剑指offer --反向输出链表与输出链表的倒数第k个元素
List.h #include "List.h" #include #include void PrintListReversingly_Iteratively(ListNode* pHead) { std::stack nodes; ListNode* pNode = pHead; while(pNode!=nullptr) { node原创 2017-05-11 19:33:51 · 309 阅读 · 0 评论 -
剑指offer --链表
#include #include #include using namespace std; struct Node { int value; Node* next; Node(int v):value(v){} }; void InsertList(Node *head,int key) { Node* NewNode = new Node(key)原创 2017-05-10 11:15:59 · 238 阅读 · 0 评论