Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Project 4 Assigned Tuesday Nov. 14 Due Mon December 4th before 11:59pm Use basic C NOT C++ Your C (basic C, NOT C++) code must

Project 4 Assigned Tuesday Nov. 14 Due Mon December 4th before 11:59pm

Use basic C NOT C++

Your C (basic C, NOT C++) code must be submitted to blackboard, no submissions to ZyLabs will be accepted. You are STRONGLY encouraged to use an IDE other than the ZyLab.

This program needs to mainly be in pointers and structs,

It is not allowed to initialize a string, we have to use malloc for that.

Basically, is this NOT acceptable:

"char userFile[100];"

Write a program that will solve a word search where each word may be appear multiple times in the puzzle. The code will output to the display and a file where in the grid all of the words were started, and which direction the word progressed, N,NE,E,SE,S,SW,W,NW The data will be stored in a file that consists of number_of_rows number_of_columns a grid of number_of_rows by number_of_columns characters. the list of words being searched for The data grid needs to be read into a dynamic array (space is malloced) and accessed via pointers The list of words being searched for should be stored in a linked list, where each node of the list uses this struct:

image text in transcribed

image text in transcribed

The data grid needs to be read into a dynamic array (space is malloced) and accessed via pointers The list of words being searched for should be stored in a linked list, where each node of the list uses this struct struct node ( char *word; // a pointer to a dynamic array that holds the word (a dynamic C-string) int length; I/ an int that holds how many characters are in word struct list first; / a pointer to a struct that will hold the index of where the word occurred and in which direction struct node nextword; I/ a pointer to a struct node that will hold the next word being searched for struct 1ist f int row int col; int orientation; struct list *next; I/ a pointer to a node of type list that will be the next location of word in puzzle Example input file: TESTA ESEEB SSESC TSETD AYUD test here are two sample input files sampleinput .bd samplefile.bt Your code should prompt for the filename, read in the data from the filename, search for the words, populate the linked lists, then print out the results from the linked lists. For the above file the output should look something like: Enter the filenane that holds the word search information: sampleinput.txt The word test was found at locations i j orientation: 3SM 3 3 N 3 3 W

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Apache Cassandra Development

Authors: Vivek Mishra

1st Edition

1484201426, 9781484201428

More Books

Students also viewed these Databases questions