Đang Thực Hiện

C++ programming for data structure and code to test it

1) First implement a dictionary tree that provides the abilities for a caller to insert words to a tree to build a dictionary and search the tree to find if a given word matches (case- insensitive search) any stored word in the tree.

2) Then write code to test your dictionary tree implementation by building a dictionary tree from a source dictionary text file and then use the dictionary tree to perform spell checks on all words read from another text file and print out all misspelled words there.

Below is a proposed code design for implementing the dictionary tree data structure and its operations:

• dictionary.h (in C or C++)

a. Defines the data structure of the dictionary tree entry described above, and the

signatures of its operations for searching a word in the dictionary and for inserting a word to the dictionary. We recommend calling the structure dictentry. If coding in C++, make dictentry a class.

b. Search operation signature:

isEndOfWord=true

p. 2

• In C, ResultType find(struct dictentry *dictnode, const char *word, const char *targetword);

• In C++, dictentry::ResultType find(const char *word, const char *targetword=nullptr);

• ResultType here could be an ENUM to indicate the result from the find call, suggested values are:

typedef enum {

CORRECT, // word has correct spelling MISSPELLED,

BADCHARS, // word has characters outside [A-Z,a-

z,'] ADDED,

EXISTS,

} ResultType;

• Implementation tips:

1. This method is initially called on the root node to start the

search.

2. Use recursive calls to traverse the tree structure to find the

word, one character at a time starting from the first character (you need to convert each character from the word to an index of a child node)

3. The “word” argument is for passing the remaining portion of the word being searched in a recursive context.

4. The “targetword” argument is an argument that is passed without modification in the call. Its main purpose is to help you understand the context in recursive debugging.

c. Insert operation signature:

• In C, ResultType insert(struct dictentry *dictnode,

const char *characters, const char *targetword);

• In C++, ResultType insert(const char *characters, const

char * targetword =nullptr);

• See above for ResultType definition

• Implementation tips:

1. This method is initially called from the root node to insert the new word

2. Use recursive calls to traverse the tree structure to insert the word, one character at a time starting from the first character (you need to convert each character from the word to an index of a child node)

3. The “characters” argument is for passing the remaining portion of the word being inserted in a recursive context.

4. The “targetword” argument is for remembering what is the target word in the insert, this is for debugging purpose in a recursive call context.

• dictionary.c (for C) or dictionary.C (for C++) for implementing dictionary.h.

Kĩ năng: Lập trình C++, Lập trình C, Kiến trúc phần mềm

Xem nhiều hơn: types of data structure in c++, data structures in c++, data structure programs in java, data structure program examples in c, data structure program examples, data structure practical programs, data structures programs in c++, data structure in c++ notes, programming project data structure, c and data structure, c# graph data structure, c map data structure, c programming data structures, c programming data structures examples, c programming data types, c programming tree data structure, c tree data structure, c-tree data structure, c using data structure, c with data structure

Về Bên Thuê:
( 1 Nhận xét ) San Diego, United States

ID dự án: #23625264

4 freelancer đang chào giá trung bình $171 cho công việc này

iridescent2x15

Hi I can deliver your DICTIONARY project. Kindly contact to share more details in chat. Thank you......

$80 USD trong 7 ngày
(70 Nhận xét)
6.1
chomsengdev

How are you? I read your description. I am C++/C#/Java/Python programming Expert. I can finish your project quickly with best quality. I want to discuss more on chat. Thank you for your time.

$500 USD trong 7 ngày
(14 Nhận xét)
5.7
archsoft54

Hello. How about today? High-quality & Fast-delivery is promised! As a highly skilled Full-Stack developer and I can help you perfectly. I am very confident with my skills and I'd like to help your business by doing my Thêm

$75 USD trong 2 ngày
(0 Nhận xét)
0.0
RiteshArora2909

Hi, I am Ritesh. The specialist skill to Data Entry Admin & virtual assistance as your requirements. 1. Data Entry & virtual assistance services. 2. Data entry, excel, word, access, PowerPoint &. Excel VBA. 3. A virtua Thêm

$30 USD trong 7 ngày
(0 Nhận xét)
0.0