Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In java I have this array = [['y', 'n' ,'o' , 'd' ,'e' 'j'], ['h' ,'s' ,'e' ,'y' 'p' 'k'], ['l' ,'p' ,'h' ,'b' ,'w'

In java I have this array = [['y', 'n' ,'o' , 'd' ,'e' 'j'], ['h' ,'s' ,'e' ,'y' 'p' 'k'], ['l' ,'p' ,'h' ,'b' ,'w' ,'a'], ['l' ,'o' ,'b' ,'w' ,'x' ,'z'], ['w' ,'o', 'b' ,'a' ,'a' ,'i'], ['p', 'l' ,'y' ,'y' ,'c' ,'g']

It represents this word search grid:

y n o d e j h s e y p k l p h b w a l o b w x z w o b a a i p l y y c g

I have this set that contains the words (node, ode, nod, ply, jed, doc, yes, spool, loops, loop, way)

The minimum word length is 3 letters.

I want to search left to right across the grid to find valid words. A word is valid if it meets the minimum word length and is also in the given set. I want to add the words that I found in a list and return them in the order they were found. You should begin at the first letter and check the word length to the end to see if a word is formed. On the top row ['y','n','o','d','e','j'] the words 'nod', 'node', and then 'ode' are found. Then continue to the next letter. For example, this one should return:

nod

node

ode

ply

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

Step: 3

blur-text-image

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

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

1489982175, 978-1489982179

More Books

Students also viewed these Databases questions