AVL Tree with new word insertion/deletion

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 3RP
icon
Related questions
Question

DO NOT REJECT, just answer any part that you can with java code

Modern computing and the Internet have made accessible a vast amount of information. The ability to efficiently search through this information is fundamental to processing it. The purpose of this project is for you to develop and implement different search algorithms. The context chosen for this task is that of a Hangman Game. Thus, developing a computer game and using algorithms at the same time!

Hangman Game Overview
Pretend a large text file containing an English dictionary is being provided. The game will either randomly select a word from the dictionary file (computer mode) or will allow a player to provide a word (player mode). In player mode, you need to search in the dictionary file whether the word provided by the player is a legitimate English word, and if not, provide an auto-correct feature to suggest to the player other words that are legitimate English words. At least three search algorithms should be implemented: a simple sequential brute-force search which assumes words are not ordered in the dictionary file, a decrease-by-constant-factor of two binary search which assumes words are ordered in the dictionary file, and the use of Binary Search Tree as a data structure to hold the data and allow insert/delete/search. Alternate brute-force, decrease-by-constant-factor, and binary search tree searches. Each of these searches should have a basic auto-correct feature that returns the “closest” word existing in the dictionary if the one provided by the user is not found.
The game should have the following basic features:
- Allow player selection of any letter of the alphabet; player is not allowed to select the same letter more than once.
- Create the person, using shapes or text, and make all the body parts invisible.
- Every time the user selects a letter that is not part of the chosen word, remove the letter from the list, and make one more body part visible.
- If all body parts are visible, then the user is hanged (a proper message appears); after the player acknowledges the endgame, the program should be restarted from the beginning, with a new word.
- Every time the player selects a letter that is part of the chosen word, remove the letter from the list, and display the letter and its position in the word; note that a letter may appear several times in the same word, if this is the case, you should display all its occurrences in the word.
- If the player is able to find the proper word, then the player wins (a proper message appears); after the player acknowledges the endgame, the program should be restarted from the beginning, with a new word.
- Add an “About” menu which, when selected, should display your information.
- Add a “Quit” menu which, when selected, should neatly quit the program; the player should be able to Quit the program at any time.
- The user interface should be either graphics-based or text-based.

Make sure to have:
- User Interface
- Random word from dictionary file
- Player-provided word with brute-force auto-correct
- Player-provided word with decrease-by-constant-factor auto-correct
- Player-provided word with Binary Search Tree auto-correct
- Letter selection and removal (good or bad) from the list
- Display of body parts when a bad letter is chosen
- Display of good letters and their positions in the word
- Outcome (good or bad) of the game
- Game Restarting
- Overall functionality and appearance of the game
- AVL Tree with new word insertion/deletion
- 2-3 Tree with new word insertion/deletion

Overall, the program should include the following:
- Hangman game basic features: user interface, random word, letter selection and removal, body parts, good letters, outcome, restarting, overall functionality
- Brute-force, decrease-by-constant-factor, and binary search tree word search with auto-correct
- Allow player to insert a new word in the dictionary that does not exist - for example, the player wants to add words from a different language; use AVL tree and/or 2-3 tree as data structure for search/insert/delete

Use Java programming language to code a hangman game that includes all of these features just stated.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Types of trees
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning