/
oop_nust_misis
/
auto_complete-sofaming
Обзор
Документация
Войти
/
oop_nust_misis
/
auto_complete-sofaming
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
master
include/library.hpp
23 строки
505 B
OOP Nust MISIS
Initial commit
27 фев 2025, 22:56
27 фев 2025, 22:56
ddce586
Код
Авторство
О чём код?
#pragma once #include <string> #include <vector> #include <unordered_map> namespace template_library { class AutoComplete { struct Node { std::unordered_map<char, Node*> children; bool is_end = false; }; Node* root = new Node(); void dfs(Node* node, std::string& path, std::vector<std::string>& result); public: void insert(const std::string& word); std::vector<std::string> suggest(const std::string& prefix); }; }