Skip to content

Instantly share code, notes, and snippets.

View lin-ion's full-sized avatar
💫

lin-ion lin-ion

💫
View GitHub Profile
#include <iostream>
#include <array>
#include <algorithm>
using std::array, std::max, std::cout, std::endl;
template<class T, size_t Col, size_t Row>
void optimization(array<array<T, Col>, Row> m)
{
array<array<T, Col>, Row> c{};
@lin-ion
lin-ion / SimpleHashTable.hpp
Created November 16, 2023 09:06
simple hash table
#pragma once
using KeyType = int;
using ValueType = int;
struct Node
{
KeyType Key;
ValueType Value;
};
@lin-ion
lin-ion / RedBlackTree.hpp
Last active November 15, 2023 14:32
binary tree visualize
#pragma once
#include <iostream>
#include <string>
#include <functional>
enum class Color { RED, BLACK };
using DataType = int;
struct RBTNode
{
RBTNode* parent = nullptr;
@lin-ion
lin-ion / Timer.hpp
Last active October 26, 2023 15:27 — forked from mcleary/Timer.cpp
C++ Timer using std::chrono
#include <ostream>
#include <chrono>
std::ostream& operator<<(std::ostream& os, std::chrono::seconds seconds)
{
return os << seconds.count() << " s";
}
std::ostream& operator<<(std::ostream& os, std::chrono::milliseconds milliseconds)
{