HOG2
|
#include <Treap.h>
Classes | |
struct | TreapNode |
Public Member Functions | |
Treap () | |
void | Reset () |
void | Add (key k) |
key | RemoveSmallest () |
bool | Remove (key &k) |
void | Iterate (double, double, const std::function< void(const key &)> &) |
const key & | Peek () |
void | Print () |
size_t | Size () |
size_t | GetHeight () |
key | GetNode (size_t) |
void | Verify () |
Private Types | |
typedef size_t | TreapNodePtr |
Private Member Functions | |
TreapNodePtr | GetNode () |
void | Recycle (TreapNodePtr n) |
void | Insert (TreapNodePtr n, TreapNodePtr head) |
void | HeapifyUp (TreapNodePtr n) |
void | RotateLeftChildUp (TreapNodePtr n) |
void | RotateRightChildUp (TreapNodePtr n) |
void | PrintHelper (TreapNodePtr n, int depth) |
void | VerifyHelper (TreapNodePtr n) |
void | Remove (TreapNodePtr n) |
size_t | GetHeightHelper (TreapNodePtr n) |
void | IterateHelper (TreapNodePtr n, double, double, const std::function< void(const key &)> &) |
Private Attributes | |
const size_t | nullTreapNode = -1 |
const size_t | rootOfTree = -2 |
TreapNodePtr | head |
std::vector< TreapNode > | nodes |
|
private |
|
private |
|
private |
key Treap< key >::GetNode | ( | size_t | which | ) |
|
private |
|
private |
void Treap< key >::Iterate | ( | double | low, |
double | high, | ||
const std::function< void(const key &)> & | f | ||
) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |