![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
(; ̄ェ ̄)。
这个作者很懒,什么都没留下…
展开
-
typescript 构建堆
class Heap { public heap: Array<any>; public type: string | number; public constructor(type: string | number) { this.heap = []; this.type = type; } private swap(i, j):void { let temp = this.heap[i]; this.heap[i] = this.heap.原创 2022-04-05 22:40:37 · 979 阅读 · 0 评论 -
数据结构 C++ 实现双链表
link.h#ifndef LINK_H#define LINK_H#pragma once#include <iostream>template<class T>class Node{public: T *data; Node<T> *pre; Node<T> *next;};template<class T>class Link{private: Node<T> *pheader; .原创 2022-03-31 15:16:15 · 1303 阅读 · 0 评论 -
C语言 数据结构 动态数组
arr2.h#include<stdio.h>#include<windows.h>#include<stdlib.h>struct list{ void **pArr; int size; int length;};typedef void * array;// 创建动态数组array create_array(int size);// 向数组后面添加元素void array_push(array arr,void *val.原创 2022-03-09 09:52:04 · 530 阅读 · 0 评论 -
C语言 数据结构 单链表
link2.h#include<stdio.h>#include<stdlib.h>#include<windows.h>struct Node{ void *data; struct Node *next;};struct pointer{ int size; struct Node pHeader;};typedef void * link;// 创建单链表link create_link();// 添加节点voi原创 2022-03-09 20:19:33 · 507 阅读 · 1 评论 -
C语言 数据结构 只维护指针域的链表
save.h#pragma once#include <stdio.h>#include <stdlib.h>#include <windows.h>struct linkNode{ struct linkNode *next;};struct pointer{ struct linkNode pHeader; int length;};typedef void *link;// 初始化链表link init_link();原创 2022-03-15 16:54:08 · 942 阅读 · 0 评论 -
数据结构C++ 实现单链表
link.h#ifndef LINK_H#define LINK_H#pragma once#include <iostream>#define OK 1#define fail 0using namespace std;template <class T>class Node{public: Node<T> *next; T *data;};template <class T>class Link{privat原创 2022-03-26 10:19:27 · 892 阅读 · 0 评论 -
数据结构C++ 实现动态数组
list.h#ifndef LIST_H#define LIST_H#pragma oncetemplate <class T>class list{private: T **pArr; int size; int length;public: list<T>(int size); // 赋值运算符重载 list<T>& operator=(const list<T> & plist);原创 2022-03-26 10:15:50 · 2465 阅读 · 0 评论