Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
arrayheap_algos.cc File Reference

Tests for Arrayheap Algos. More...

#include <algorithm>
#include <ranges>
#include <vector>
#include <gtest/gtest.h>
#include <tpl_arrayHeap.H>
Include dependency graph for arrayheap_algos.cc:

Go to the source code of this file.

Functions

static bool is_min_heap (const std::vector< int > &v)
 
 TEST (ArrayHeapAlgos, ValidHeapDetectsHeapAndNonHeap)
 
 TEST (ArrayHeapAlgos, SiftUpRestoresHeapAfterInsertAtEnd)
 
 TEST (ArrayHeapAlgos, SiftDownRestoresHeapAfterRootViolation)
 
 TEST (ArrayHeapAlgos, SiftDownUpRestoresHeapAfterInternalUpdate)
 
 TEST (ArrayHeapAlgos, HeapsortMatchesStdSort)
 
 TEST (ArrayHeapAlgos, FasterHeapsortMatchesStdSort)
 

Detailed Description

Tests for Arrayheap Algos.

Definition in file arrayheap_algos.cc.

Function Documentation

◆ is_min_heap()

static bool is_min_heap ( const std::vector< int > &  v)
static

Definition at line 49 of file arrayheap_algos.cc.

References cmp(), Aleph::maps(), Aleph::HTList::size(), and Aleph::valid_heap().

Referenced by TEST().

◆ TEST() [1/6]

TEST ( ArrayHeapAlgos  ,
FasterHeapsortMatchesStdSort   
)

◆ TEST() [2/6]

TEST ( ArrayHeapAlgos  ,
HeapsortMatchesStdSort   
)

◆ TEST() [3/6]

TEST ( ArrayHeapAlgos  ,
SiftDownRestoresHeapAfterRootViolation   
)

Definition at line 90 of file arrayheap_algos.cc.

References cmp(), Aleph::maps(), Aleph::sift_down(), and Aleph::valid_heap().

◆ TEST() [4/6]

TEST ( ArrayHeapAlgos  ,
SiftDownUpRestoresHeapAfterInternalUpdate   
)

Definition at line 102 of file arrayheap_algos.cc.

References cmp(), Aleph::maps(), Aleph::sift_down_up(), and Aleph::valid_heap().

◆ TEST() [5/6]

TEST ( ArrayHeapAlgos  ,
SiftUpRestoresHeapAfterInsertAtEnd   
)

Definition at line 75 of file arrayheap_algos.cc.

References cmp(), Aleph::maps(), Aleph::sift_up(), and Aleph::valid_heap().

◆ TEST() [6/6]

TEST ( ArrayHeapAlgos  ,
ValidHeapDetectsHeapAndNonHeap   
)

Definition at line 62 of file arrayheap_algos.cc.

References is_min_heap(), and Aleph::maps().