Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In C++, create a Trie data structure which can handle the following text: \"I li

ID: 3695724 • Letter: I

Question

In C++, create a Trie data structure which can handle the following text: "I like food". The user will enter the text. After you build the Trie, allow the user to enter a single word and determine whether or not it was in the original text. Provide 2 functions: (1) Receive the text and build the trie; (2) Receive a word and determine whether it exists within the text.

Also, include the following features in the program:

(a). Identify at what position within the text the word appears.

(b). Be able to cope with the following text: "I like fine fresh food, but only if it is fresh".

(c). Incorporate both (a) and (b).

(d). Let the user search for "fresh" and tell the user in all the places it appears.

Explanation / Answer

Simple program that exits and returns a# status code back to the Linux kernel

##INPUT: none

##OUTPUT:

returns a status code. This can be viewed

# by typing

## echo $

## after running the program

##VARIABLES:

# %eax holds the system call number

# %ebx holds the return status

#.section .data.section .text.globl _start _start:movl $1, %eax # this is the linux kernel command

# number (system call) for exiting

# a programmovl $0, %ebx

# this is the status number we will

# return to the operating system.

# Change this around and it will

# return different things to

# echo $?int $0x80

# this wakes up the kernel to run

# the exit command