
数据结构
CodingFishzhi
物联网/人工智能
展开
-
线段树 c++实现
#include<cstdio>#include<iostream>using namespace std;#define MAXSIZE 1000void build_tree(int arr[], int tree[], int node, int start, int end){ if(start == end){ tree[node] = arr[start]; }else{ int mid = (start +原创 2020-08-16 17:40:02 · 484 阅读 · 0 评论 -
【数据结构】单链表的初始化及其运算操作
#include <iostream>#include <cstdio>#include <stdlib.h>using namespace std;//定义单链表的节点typedef struct LNode{ int data; struct LNode *next;}LNode, *LinkList;bool InsertPriorNode(LinkList &L,LNode *p, LNode *s);bool Inse原创 2020-07-27 22:14:15 · 1594 阅读 · 0 评论