剑指offer
剑指offer
wwssppp
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
堆
堆 // Heap.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> #include <queue> using namespace std; int heap[1000]; int heap_size = 0; void PercDown(int num) { int parent, child; int x = heap[num]; for (parent = num; parent *原创 2020-09-29 11:17:07 · 138 阅读 · 0 评论 -
排序算法
// sort.cpp : 定义控制台应用程序的入口点。 // #include <iostream> #include <algorithm> using namespace std; const int MAX = 100000; int a[MAX]; void buddleSort(int* a, int L) { for (int i = 1; i &l...原创 2020-05-06 16:39:20 · 165 阅读 · 0 评论 -
二叉树的一些操作
二叉树的一些操作 /* * https://blog.youkuaiyun.com/alxe_made/article/details/94721195 */ #include <iostream> #include <array> #include <vector> #include <stack> using namespace std; cla...原创 2020-05-04 14:33:26 · 158 阅读 · 0 评论 -
重建二叉树
输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。 假设输入的前序遍历和中序遍历的结果中都不含重复的数字。 例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6}, 则重建二叉树并返回。 根据前序遍历与中序遍历,重建二叉树 /** * Definition for binary tree * struct TreeNode { * ...原创 2020-05-04 08:15:15 · 163 阅读 · 0 评论
分享