#include <stdlib.h>
#include <iostream>
#define MAX_LEN 1000
void build_tree(int arr[], int tree[], int node, int start, int end)
{
if (start == end)
{
tree[node] = arr[start];
}
else {
int mid = (start + end) / 2;
int left_node = 2 * node + 1;
int right_node = 2 * node + 2;
build_tree(arr, tree, left_node, start, mid);
build_tree(arr, tree,
线段树,(segement tree)
最新推荐文章于 2023-05-23 21:50:45 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)