C# Class MinHeap, Corsair

Minimum Heap
Exibir arquivo Open project: Final-Parsec/Corsair Class Usage Examples

Public Properties

Property Type Description
heap List

Public Methods

Method Description
Add ( Node, element ) : void

Adds an element to the heap and bubbles up.

Count ( ) : int
GetRoot ( ) : Node,

Gets the root.

MinHeap ( Node, root ) : System
MinHeapify ( int index ) : void

Mins the heapify.

Peek ( ) : Node,
Reevaluate ( Node, element ) : void

Private Methods

Method Description
BubbleUp ( int index ) : void
Swap ( int a, int b ) : void

Swap the specified list items, a and b.

Method Details

Add() public method

Adds an element to the heap and bubbles up.
public Add ( Node, element ) : void
element Node, element to add
return void

Count() public method

public Count ( ) : int
return int

GetRoot() public method

Gets the root.
public GetRoot ( ) : Node,
return Node,

MinHeap() public method

public MinHeap ( Node, root ) : System
root Node,
return System

MinHeapify() public method

Mins the heapify.
public MinHeapify ( int index ) : void
index int Index.
return void

Peek() public method

public Peek ( ) : Node,
return Node,

Reevaluate() public method

public Reevaluate ( Node, element ) : void
element Node,
return void

Property Details

heap public_oe property

public List heap
return List