Question
You do not get a starter file. You must write it completely from scratch. Your solution should only open the dictionary file ONCE and convert
You do not get a starter file. You must write it completely from scratch.
Your solution should only open the dictionary file ONCE and convert the dictionary words to canonical form ONCE (and store them in a container).
There are many possible overall approaches to solving the Jumbles problem. You may solve it any way you can as long as you avoid processing the dictionary words more than once. Also you must generate the EXACT OUTPUT and you must not use TreeSet, TreeMap, HashSet, HashMap etc or any variant of these templated <> containers. Stick to plain arrays and ArrayLists. You may emulate a HashMap using ArrayList and or plain arrays if you happen to know what a HashMap is, but you may not use Java's Hash or Tree containers because those containers actually trivialize the problem. Later in the course you will solve jumbles with a Java HashMap for a simple lab exercise and find it is only a dozen or so lines of code to do it. For this exercise you must use only the tools we have given you thus far. Also Call Static String Method for the Array.sort of the letters.
Your program should take two command args: a dictionary file and a jumbles file. For each jumbled word you must find all the matching dictionary words and print them after the jumbled word ion the line.
Here is the dictionary.txt and jumbles.txt I will test with.
Here is a tiny version of each input that you should test with until you are sure your code is correct: tinyDictionary.txt and tinyJumbles.txt and correct output for it them: tinyCorrectOuput.txt.
tinyDictionary.txt
act cat tac dog god post pots stop spot tops opts rat tar art trap tarp part flog golf frog gorp glossy
tinyJumbles.txt
atc otsp gdo atr arpt grof sylogs
tinyCorrectOuput.txt.
arpt part tarp trap atc act cat tac atr art rat tar gdo dog god grof frog otsp opts post pots spot stop tops sylogs glossy
Here is the correct execution command and output from a sample run of your program YOUR OUTPUT MUST MATCH EXACTLY. Notice the list of jumbles words is sorted vertically and the matching dictionary words that come after are sorted left to right.
java Project8 dictionary.txt jumbles.txt addej jaded ahicryrhe hierarchy alvan naval annaab banana baltoc cobalt braney nearby celer creel couph pouch cukklen knuckle dica acid cadi caid dobeny beyond dobol blood dufil fluid dupled puddle eslyep sleepy ettniner renitent ettorp potter genjal jangle gluhc gulch hartox thorax hoybis boyish hucnah haunch iddec diced irrpo prior kutbec bucket lappor poplar lasia alias laurib burial lubly bully meefal female milit limit mopsie impose mycall calmly nekel kneel nokte token noper prone nwae anew wane wean nyegtr gentry perrim primer preko poker pudmy dumpy pypin nippy rebisc scribe rodug gourd rpeoims imposer promise semipro shewo howes whose wardty tawdry warllc yaldde deadly
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started