Skip to content
Snippets Groups Projects
Commit 322700c8 authored by CHABAKA ALI IBRAHIM REDA MAH p2200473's avatar CHABAKA ALI IBRAHIM REDA MAH p2200473
Browse files

fichier gadag et node

parent 6928bb76
No related branches found
No related tags found
No related merge requests found
#include "gadag.hpp"
gaddag::gaddag() {
root = new Node();
}
~Gaddag::gaddag() {
clear(root);//supprimer tous le gadag
}
#ifndef GADDAG_H
#define GADDAG_H
#ifndef gaddag_H
#define gaddag_H
#include <map>
#include <string>
#include "node.hpp"
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 {
struct gaddag {
Node* root;
Gaddag();
~Gaddag();
gaddag();
~gaddag();
void insert(string word);
bool search(string word);
void clear(Node* node);
......
node::node(){
isTerminal=false;
}
\ No newline at end of file
ifndef Node_H
#define Node_H
#include <map>
#include <string>
struct Node {
bool isTerminal; // Indique si le nœud est terminal
map<char, Node*> children; // Enfants du nœud
Node();
};
#endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment