-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSource.cpp
50 lines (40 loc) · 886 Bytes
/
Source.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include<iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <memory>
#include "singleLinkList.h"
#include "BinaryTree.h"
#include "algorithm_.h"
#include <stack>
#include <boost/regex.hpp>
#include <boost/asio.hpp>
// µ¥Àý - ÀÁººÊ½/¶öººÊ½¹«ÓÃ
using namespace boost;
void unique_again(std::vector<int>& vec)
{
int* p = vec.data();
int* q = p;
int* last = p + vec.size();
int newSize = 0;
while (p < last)
{
while (((p + 1) < last) && (*p == *(p + 1)))
{
++p;
}
*q++ = *p++;
++newSize;
}
vec.resize(newSize);
}
int main(int argc, char *argv[])
{
int arr[] = { 8, 4, 10, 2, 6, 9, 11, 1, 3, 5, 7 };
BinaryTree* proot = creatBinaryTree(arr, 0, sizeof(arr) / sizeof(int));
//mid_order_access(proot);
level_access(proot);
std::cout << height(proot);
std::cin.get();
return 0;
}