Skip to content
Snippets Groups Projects
gadag.hpp 389 B
Newer Older
#ifndef GADDAG_H
#define GADDAG_H

#include <map>
#include <string>
using namespace std;
struct Node {
    bool isTerminal; // Indique si le nœud est terminal
    map<char, Node*> children; // Enfants du nœud

    Node();
};

struct Gaddag {
    Node* root;

    Gaddag();
    ~Gaddag();
    void insert(string word);
    bool search(string word);
    void clear(Node* node);
};

#endif