-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWordDictionary.cpp
More file actions
executable file
·66 lines (41 loc) · 865 Bytes
/
WordDictionary.cpp
File metadata and controls
executable file
·66 lines (41 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// WordDictionary.cpp
// leetcode
//
// Created by witwolf on 5/19/15.
// Copyright (c) 2015 witwolf. All rights reserved.
//
#include <string>
using namespace std;
struct Node;
struct Node{
Node(){childs=NULL;}
Node* childs;
};
class Trie{
public:
Trie(){
root = new Node;
}
void addWord(string word){
Node *node = root;
for(char c:word){
}
}
bool search(string word){
return false;
}
private:
Node* root;
};
class WordDictionary {
public:
// Adds a word into the data structure.
void addWord(string word) {
}
// Returns if the word is in the data structure. A word could
// contain the dot character '.' to represent any one letter.
bool search(string word) {
return false;
}
};