From c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c Mon Sep 17 00:00:00 2001 From: Martial Simon Date: Mon, 15 Sep 2025 01:08:27 +0200 Subject: add: graphs et rushs --- graphs/cpp/lookup_table/lookup_table.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 graphs/cpp/lookup_table/lookup_table.cc (limited to 'graphs/cpp/lookup_table/lookup_table.cc') diff --git a/graphs/cpp/lookup_table/lookup_table.cc b/graphs/cpp/lookup_table/lookup_table.cc new file mode 100644 index 0000000..0440e61 --- /dev/null +++ b/graphs/cpp/lookup_table/lookup_table.cc @@ -0,0 +1,14 @@ +// +// Created by martial.simon on 2/26/25. +// +#include "lookup_table.hh" +std::optional LookupTable::get(int x) +{ + if (table_.count(x) == 0) + return std::nullopt; + return table_.at(x); +} +void LookupTable::set(int x, long value) +{ + table_.insert_or_assign(x, value); +} \ No newline at end of file -- cgit v1.2.3