49 std::cout << label <<
" [";
50 for (
size_t i = 0; i < values.
size(); ++i)
54 std::cout << values[i];
67 105, 110, 115, 120, 125, 130, 135,
68 140, 145, 150, 155, 160, 165, 170
71 std::cout <<
"B+ Tree example\n";
72 std::cout <<
"==============\n";
76 if (
const auto lb =
ledger.lower_bound(128);
lb.has_value())
77 std::cout <<
"lower_bound(128) -> " << *
lb <<
'\n';
79 if (
const auto ub =
ledger.upper_bound(145);
ub.has_value())
80 std::cout <<
"upper_bound(145) -> " << *
ub <<
'\n';
88 <<
"BPlus_Tree example produced an invalid tree";
90 std::cout <<
"\nafter updates\n";
91 std::cout <<
"-------------\n";
94 std::cout <<
"size : " <<
ledger.size() <<
'\n';
95 std::cout <<
"height : " <<
ledger.height() <<
'\n';
97 std::cout <<
"\nB+ Tree keeps user keys in the leaves, so range scans walk leaf links.\n";
99 catch (
const std::exception &
ex)
101 std::cerr <<
"bplus_tree_example failed: " <<
ex.what() <<
'\n';
Exception handling system with formatted messages for Aleph-w.
#define ah_runtime_error_unless(C)
Throws std::runtime_error if condition does NOT hold.
Simple dynamic array with automatic resizing and functional operations.
constexpr size_t size() const noexcept
Return the number of elements stored in the stack.
Generic B+ Tree with configurable minimum degree.
Main namespace for Aleph-w library functions.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
void print_array(const char *label, const Container &a)
B+ Tree implementation with linked leaves and configurable degree.