mirror of
https://git.wolves.top/wolves/leetcode.git
synced 2025-11-04 17:26:32 +08:00
init
This commit is contained in:
23
dataStruct/Heap/Heap.h
Normal file
23
dataStruct/Heap/Heap.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Created by 李洋 on 2023/8/12.
|
||||
//
|
||||
|
||||
#ifndef LEECODE_C_HEAP_H
|
||||
#define LEECODE_C_HEAP_H
|
||||
|
||||
#include "vector"
|
||||
template<typename T>
|
||||
class Heap {
|
||||
private:
|
||||
std::vector<T> array;
|
||||
public:
|
||||
int length;
|
||||
|
||||
Heap(std::vector<T> &array) : array(array){
|
||||
length = array.size();
|
||||
}
|
||||
|
||||
typedef void (Heap::*compare(T a,T b))(bool);
|
||||
};
|
||||
|
||||
#endif //LEECODE_C_HEAP_H
|
||||
Reference in New Issue
Block a user